How to configure practice environment of Ansible?

Configure using VirtualBox
Feb 22, 2024
How to configure practice environment of Ansible?

Introduce

Thank you for clicking through to my arcticle. I've been a DevOps engineer for 2 years in dev-team of 7 engineers.

My name is MINSEOK, LEE, but I use Unchaptered as an alias on the interenet. So, you can call me anythings "MINSEOK, LEE" or "Unchaptered" to ask something.

Prerequisites

STEP 1 : Install Virtual Box

STEP 2 : Install CentOS for Windows

  1. Click your OS' Architecture.

  2. Click your Download Link. (recommend kakao or naver)

  3. Choose minimal iso file

STEP 3 : Create New VM

  1. Create New.

  2. Select ISO Image.

  3. Check Username and Password.

  4. Set up HW spec to Virtual MEM as 1024MB and Processor CPU 1.

  5. Set up Disk spec to Virtual Disk 16.00GiB.

  6. Check your VM Image.

  7. Change Network Adaptor settings from NAT to Adaptor Bridge.

  8. Change shortcuts from Host Key from Right Ctrl to Ctrl+Alt.

  9. Launch "Ansible-Server" and Type enter.

  10. Set up Machine Language English or your Native Language.

  11. Check destination and disable for storage about KDUMP.

  12. Set up [NETWORK & HOSTNAME] from init to Ansible-Server.
    Please set-up hostname is equaled VM Image name.
    And hostname can't support Uppercase.

  13. Set up password in [CONFIGURATION].

  14. Launch "Ansible-Server" and type "root" and your password in step 13.
    You can close VM using poweroff

  15. Copy "Ansible-Server" to "Ansible-node1", "Ansible-node2", "Ansible-node3"
    A new MAC address assignment is required.

    Also, since "Ansible-node*" doesn't need much disk, we'll allocate it with 1/2 the capacity.

    1. Right-click origin VM to copy Ansible-node1, 2, 3...

    2. Click special-mode

    3. Change Mac Address Policy from "NAT Network Adaptor include mac address only" to "All Network Adaptor create mac address"

    4. Click Confirm(F)

    5. Change Virtual MEM from 1024 MiB to 514 MiB
      In this practice, target machine don't needs high performance.

  16. Launch all VM Images, such as "Ansible-Server" and "Ansible-node*".

  17. Change hostname from ansible-server(default) to ansible-node-n

hostnamectl set-hostname ansible-node01
hostnamectl set-hostname ansible-node02
hostnamectl set-hostname ansible-node03
  1. Set IP Address in each VM.
    Because we set the network settings to Adaptor Bridge above, the VMs currently have no IPs.
    SERVER_NAME | IP_ADDRESS | SUBNET_MASK | GATEWAY

    Ansible-Server | 192.168.1.10. | 255.255.255.0 | 192.168.1.1.

    Ansible-Node01 | 192.168.1.11. | 255.255.255.0 | 192.168.1.1.

    Ansible-Node02 | 192.168.1.12. | 255.255.255.0 | 192.168.1.1.

    Ansible-Node03 | 192.168.1.13. | 255.255.255.0 |192.168.1.1.

    1. Enter nmtui

    2. Click [Edit a Connection]

    3. Click [Edit ...]

    4. Type [IPv4 CONFIGURATION], [Gateway] and check [Automatically connect], after then click [OK]
      Must be checked as Manual.

    5. Click [Back]

    6. Click [OK]

  2. Restart network settings using systemctl restart network

    1. Check IP Address using ip add

    2. Check Gateway using ping 192.168.1.1

Share article
RSSPowered by inblog