Ansible/First Instruction

From PKC
Jump to navigation Jump to search

Test to see if Ansible can access the machines

One must supply the following data points to enable Ansible to access the machines:

  1. all for all the machines listed in the inventory file in the current working directory.
  2. -i for input file, in this case, the inventory file in the current working directory.
  3. --key-file for the secret key file, in this case, the ~/.ssh/ansible.pem is the one that is shared with all the nodes.
  4. -u for user name, in this case, ubuntu is the user associated with the key file.
  5. -m for module name, in this case, ping is the module to be executed.
ansible all -i inventory --key-file ~/.ssh/ansible.pem -u ubuntu -m ping