Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 1.19 KB

README.md

File metadata and controls

17 lines (11 loc) · 1.19 KB

Ansible at scale - working with multiple environments

Demo repository

To reproduce:

  • Create three Ubuntu Server 24.04 machines or later.
  • On your developer PC (where you will be running ansible-playbook from), create hosts entries in /etc/hosts for the machines pointing the hostnames from the hosts file to the relevant IPs.
  • Configure SSH key authentication on the machines or be lazy like me and enable root password login by modifying /etc/ssh/sshd_config, setting PermitRootLogin yes.
  • Set the password of the root users in each machine to the same password (note: NOT recommended for production! This is where using keys becomes convenient and safer).
  • On your developer PC run ansible-playbook -i environments/ubuntu playbooks/ubuntu.yml --ask-pass and type in the root password you just configured (leave out --ass-pass if you are using keys).

(Please note that the html_root in the group_vars/all/main.yml file is not actually used - but easily could be.)

Congratulations, you now have three apache servers!

Please refer to the Medium blog post for further details.