Automation and Ansible - skyleroriordan/my-tech-journal GitHub Wiki
For this lab I used ansible to automate.
Started out with a ubuntu box to work as the controller and two centos boxes called ansible1 and ansible2.
Installed ansible on the controller using the command: sudo apt install ansible sshpass python3-paramiko Then I used ansible --version to check it was installed.
created a file /etc/sudoers.d/sys265
Created an RSA key pair and used ssh-add -t 14400 to decrypt the key for 4 hours.
I used the ad-hoc command ansible all -a hostname -i inventory.txt
Created an inventroy.txt file for ansible:
Used ansible-galaxy install mariuszczyz.centos_apcahe -p roles to install get the playbook to install an apache webserver on ansible1.
created a apache.yml file then used ansible-playbook -i inventoty.txt roles/apache.yml to implement the playbook.
Created an html page in /var/www/html on ansible1:
I used the command ansible windows -i inventory.txt -m win_ping -u [email protected] --ask-pass to ping mgmt01 using ansible.