6. Ansible

Official Documentation for the Ansible Module can be found on this link .

Add & Delete Hosts with Ansible

Step

Instructions

1

SSH into the Ubuntu Orchestrator (administrator/vpn123) using MobaXterm:

2

Change directory to : cd /home/administrator/Ansible

3

Review the file hosts.yml – view the hostname in the script :

cat hosts.yml

4

Open SmartConsole to the Network Objects > Hosts view.

5

Run the following command to execute the Ansible Play :

ansible-playbook hosts.yml

6

2 New Hosts were added :

7

Change the state option in each host to absent (Use nano or vi to edit the file : hosts.yml):

8

Run the following command and watch SmartConsole :

ansible-playbook hosts.yml

The hosts should be deleted.