RH294 Ch 2: Managed Nodes and Inventories
WebAsha is moving its servers to Ansible. Set up the project on control so the `devops` automation account can reach all four nodes with SSH keys and become root without a password.
Tasks
- Create ~/ansible/inventory: node1 in group dev, node2 in test, node3 and node4 in prod, and a group webservers whose child group is prod.
- Create ~/ansible/ansible.cfg that uses that inventory, connects as devops, and escalates privilege with sudo by default.
- Generate an SSH key for student and copy it to devops on all four nodes (password devops).
- On every node, let devops run any command with sudo without a password, using a file in /etc/sudoers.d.
- Prove it works: ansible all -m ping and ansible all -m command -a id (which must show uid=0(root)) succeed from ~/ansible.