Skip to main content

Ansible

Ansible installation

Log in where you want to make your ansible server then run this commands:

sudo apt update && sudo apt install nala
sudo nala install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo nala install ansible -y

You can create a shared folder where you can put all your ansible script if you need to share it with other people in the team

sudo mkdir /usr/share/ansible
sudo chmod g+w -R /usr/share/ansible/
sudo chown -R root:<dev group> /usr/share/ansible/

For more safety you can replace the root user by an system user like for exemple sys_ansible


Ansible commands

To execute playbook

ansible-playbook -K -i <inventaire> <playbook>