Monday, July 11, 2022

Grouping in the ansible hosts file

 We will add a group to have my 2 clients



cat ansible/hosts/hosts.ini

[client01]

10.x.y.z ansible_user=root ansible_password=ABC123


[client02]

10.a.b.c ansible_user=root ansible_password=XYZ123


[all:children]

client01

client02


ansible all -i ansible/hosts/hosts.ini -m ping

10.x.y.z  | SUCCESS => {

    "ansible_facts": {

        "discovered_interpreter_python": "/usr/bin/python3"

    },

    "changed": false,

    "ping": "pong"

}

10.a.b.c | SUCCESS => {

    "ansible_facts": {

        "discovered_interpreter_python": "/usr/bin/python3"

    },

    "changed": false,

    "ping": "pong"

}


No comments:

Post a Comment

Install Vault on ubuntu 20

 Today I will install vault on ubuntu 20 to use it as a part of my Ansible learning journey  Add GPG key curl -fsSL https://apt.releases.has...