15 - Ansible Checklist
15 - Ansible Checklist
Configuration Management
with Ansible
Introduction to Ansible
❏ Watched video
Install Ansible
❏ Watched video
❏ Demo executed - Install Ansible
Useful Links:
● Installation Guide:
https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
Ansible Inventory
❏ Watched video
❏ Demo executed
❏ Hosts file created
❏ Pinged servers with Ansible command
❏ Watched video
❏ Demo executed
❏ Added to known_hosts and authorized_keys
❏ Disabled Host Key Checking
Modules used:
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.ht
ml
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/service_modul
e.html
- Automatically executed by Ansible:
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/gather_facts_
module.html
Check your progress... 3/12
Useful Links:
Ansible Collections
❏ Watched video
Useful Links:
- Collection Index:
https://docs.ansible.com/ansible/latest/user_guide/collections_using.html
- Ansible Collections - Version 2.10 Changes:
https://github.com/ansible-collections/overview
- Ansible Galaxy: https://galaxy.ansible.com/
- Developing own Collections:
https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html
Check your progress... 4/12
❏ Watched video
❏ Demo executed
❏ Created DigitalOcean Droplet
❏ Adjusted hosts file
❏ Written Play “Install node and npm”
❏ Written Play “Deploy nodejs app”
Useful Links:
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/unarchive_module.html
❏ Watched video
❏ Demo executed
❏ Written Play “Deploy nodejs app”
- https://docs.ansible.com/ansible/latest/collections/community/general/npm_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/command_module.html
- https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/debug_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/shell_module.html
Check your progress... 5/12
❏ Watched video
❏ Demo executed
❏ Written Play “Create new linux user for node app”
❏ Adjusted Play “Deploy nodejs app”
Useful Links:
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html
Variables in Ansible
❏ Watched video
❏ Demo executed
Useful links:
- https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html
Check your progress... 6/12
❏ Watched video
❏ Demo executed
❏ Created DigitalOcean Droplet
❏ Adjusted hosts file
❏ Written Play “Install java and net-tools”
❏ Written Play “Download and unpack Nexus installer”
Useful Links:
- Conditionals in Ansible:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/get_url_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/find_module.html
- https://docs.ansible.com/ansible/2.10/collections/ansible/builtin/stat_module.html
❏ Watched video
❏ Demo executed
❏ Written Play “Create nexus user to own nexus folders”
❏ Written Play “Start nexus with nexus user”
❏ Written Play “Verify nexus running”
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/group_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/blockinfile_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/pause_module.html
Check your progress... 7/12
❏ Watched video
❏ Demo executed
❏ Watched video
❏ Demo executed
❏ Created EC2 Instance with Terraform
❏ Adjusted hosts inventory file
❏ Written Play “Install python3 and docker”
❏ Written Play “Install docker-compose”
❏ Written Play “Start docker daemon”
❏ Written Play “Add ec2-user to docker group”
❏ Refactored the Playbook
Useful Links:
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/yum_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/pipe_lookup.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/systemd_module.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/meta_module.html
Check your progress... 8/12
❏ Watched video
❏ Demo executed
❏ Adjusted 1st Play to “install docker python module”
❏ Written Play “Test docker pull”
❏ Written Play “Start docker containers”
❏ Executed Playbook on new server
❏ Created new user and adjusted plays to make the playbook more general-purpose
Useful Links:
● You can use the docker-compose.yaml file from this project:
https://gitlab.com/devops-bootcamp3/bootcamp-java-mysql/-/tree/ansible
● Interactive Prompts:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_prompts.html
- https://docs.ansible.com/ansible/latest/collections/community/docker/docker_image_mod
ule.html
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/pip_module.html
- https://docs.ansible.com/ansible/latest/collections/community/docker/docker_login_modul
e.html
- https://docs.ansible.com/ansible/latest/collections/community/docker/docker_compose_m
odule.html
Check your progress... 9/12
❏ Watched video
❏ Demo executed
❏ Adjusted Terraform configuration file to execute ansible playbook
❏ Created new Ansible Playbook for Terraform integration
❏ Written Play “Wait for ssh connection”
❏ Used“null_resource” in Terraform configuration file
Useful Links:
● Ansible part of the Terraform project:
https://gitlab.com/nanuchi/terraform-learn/-/tree/feature/ansible
● TF Provisioner:
https://www.terraform.io/docs/language/resources/provisioners/syntax.html
● TF Null Resource:
https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource
- https://docs.ansible.com/ansible/latest/collections/ansible/builtin/wait_for_module.html
Check your progress... 10/12
Dynamic Inventory
❏ Watched video
❏ Demo executed
❏ Terraform - Created EC2 Instances
❏ Written plugin configuration for aws_ec2
❏ Adjusted TF config for public DNS assignment
❏ Adjusted Ansible playbook and ansible.cfg to use dynamic hosts from AWS
❏ Added a 4th server and re-executed Ansible playbook
❏ Targeted only specific servers in your AWS region (filter + keyed_groups)
Useful Links:
❏ Watched video
❏ Demo executed
❏ Terraform - Created K8s cluster
❏ Written Play “Deploy app in new namespace”
❏ Set kubeconfig environment variable
Useful Links:
- https://docs.ansible.com/ansible/latest/collections/community/kubernetes/k8s_module.ht
ml
❏ Watched video
❏ Demo executed - Preparation
❏ Created Droplet on DO (for Ansible Control Node)
❏ Configured Droplet as Ansible Control Node (Install Ansible etc.)
❏ Created 2 EC2 Instances (for Ansible Managed Nodes)
Useful Links:
❏ Watched video
❏ Demo executed - Jenkins Pipeline
❏ Installed necessary Jenkins Plugins
❏ Configured Credentials for DO Droplet (Private Key for Ansible Server &
EC2 Managed Servers)
❏ Written Jenkinsfile
❏ Created Pipeline in Jenkins
❏ Watched video
❏ Demo executed - Optimizations
Ansible Roles
❏ Watched video
❏ Demo executed
❏ Created Roles
❏ Used Roles in Playbook
❏ Created EC2 servers with Terraform
❏ Executed Ansible Playbook
Useful Links:
● Official Doc:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html
● Variable Precedence:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#vari
able-precedence-where-should-i-put-a-variable