by Nicolas MICHEL @vpackets / LinkedIn / Blog
This disclaimer informs readers that the views, thoughts, and opinions expressed in this series of posts belong solely to the author, and not necessarily to the author’s employer, organization, committee or other group or individual.
Multiple playbooks that will perform basic function on Ubuntu (tested with 18.04.3 and 22.04 LTS) : Install package - Install Docker - Reboot and Update.
- Python (≥ 2.6)
- Ansible
- PyVmomi
├── Readme.md
├── hosts.ini
├── reboot.yml
├── ubuntu18.04
│ ├── README.md
│ ├── docker-stop-test-container.yaml
│ ├── docker-sudo.yaml
│ ├── install-docker.yaml
│ ├── install-package.yaml
│ ├── reboot.yaml
│ └── update.yaml
└── update_upgrade_playbook.yml
For this particular playbook I have copied my ssh keys to the remote server.
- Generate the ssh keys
ssh-keygen -t ed25519 -C "[email protected]"
- Copy the SSH keys to the remote servers
ssh-copy-id user@server
Also this repo contains an example of the hosts.ini configuration that could be used for this playbook. Make sure to rename the hosts-example.ini into hosts.ini and modify that file to reflect your servers IP address and credentials.
This playbook will also upgrade containerlab
ansible-playbook -i hosts.ini update_upgrade_playbook.yml --ask-become-pass
ansible-playbook -i hosts.ini reboot.yml --ask-become-pass
ansible-playbook -k --extra-vars "ansible_user=nmichel" --ask-become-pass update.yaml
ansible-playbook -k --extra-vars "ansible_user=nmichel" --ask-become-pass reboot.yaml
ansible-playbook -k --extra-vars "ansible_user=nmichel" --ask-become-pass install-package.yaml
ansible-playbook -k --extra-vars "ansible_user=nmichel" --ask-become-pass install-docker.yaml
ansible-playbook -k --extra-vars "ansible_user=nmichel" --ask-become-pass docker-sudo.yaml
ansible-playbook -k --extra-vars "ansible_user=nmichel" --ask-become-pass docker-stop-test-container.yaml
ansible-playbook -k --extra-vars "ansible_user=nmichel" --ask-become-pass complete-deployment.yaml