Ansible/First Instruction

From PKC
Revision as of 09:28, 3 August 2021 by Benkoo (talk | contribs) (Created page with "==Test to see if Ansible can access the machines== One must supply the following data points to enable Ansible to access the machines: #<code>all</code> for all the machines l...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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