This is how I helped Senior Lab Manager
to install packages in all the labs using his main computer. I automated the process of installing packages using ansible playbook on around 150 computers present in my college.
This playbook installs nmap
and nginx
packages directly from the net and install java from the java rpm file
downloaded by the master node by pushing it to the remote machines.
- Configure config file.
cat ~/.ansible.cfg
- Add the remote hosts ips in inventory file using
cat ~/inventory
- check
ansible all --list-hosts
- Edit
main.yml
according to the main.yml file. - Install java.
wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/14.0.2+12/205943a0976c4ed48cb16f1043c5c647/jdk-14.0.2_linux-x64_bin.rpm
- Run ansible file
ansible-playbook -i inventory main.yml
- ansible web -m ping
- ansible node-1 -m shell -a 'hostname'