You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Obtain enough information about the working of Ansible and use this knowledge to improve the quality of the currently existing playbook structure for installation.
Steps to work on
Variable scoping in Ansible
Modules: Nature of scoping, how can we improve our playbooks using them, advantage of using well defined modules vs running commands using the shell module, and similarity with functions
Retain the ansible logs when run through playbook (see serverfault). All ansible modules return stdout and stderror. Please see ansible docs.
Including .ansible.cnf in our structure.
What happens when hostname is not present in the inventory file?
Iterating over groups of hosts in the inventory Mongo DB example.
Find out the most frequently used modules, like apt, and the modules used in our yml files and how we can use them better.
Waiting for Gitlab during installation can be done like here.
Iterating over execution nodes to install in ansible
Use Ansible tags to run selective tasks in a playbook
Use Ansible variable and task includes along with tags to create extra execution nodes.
Expected behavior
Simpler ansible playbook files that reduces the complexity of installation.
Additional Information
A good resource for ansible examples is the resource shared by Ansible project.
The Ansible docs should help in finding the answers for almost all the points above.
The text was updated successfully, but these errors were encountered:
The ansible logs can be retained by using DeBUG . The module/task can be assigned a
register and then , using parameter : var , statements during the execution can be obtained.
The current code has the local inventory file which can be directly passed to ansible by overriding the
ansible.cnf file.
First ansible looks for the hosts in the local inventory , if not found would look in the default file for
hosts which is "/etc/ansible/hosts" . If not found , then it shows that host is not matched.
4.Iterating over the execution nodes might not work . This feature is module dependent .Ansible runs
each loop iteration as separate run, so would end up with different ssh sessions.
There are some exceptions described in Ansible_Squash_variables variable: "apk, apt, dnf,
package, pacman, pkgng, yum, zypper"
These modules are smart enough to squash all items into a single task call.
Description
Obtain enough information about the working of Ansible and use this knowledge to improve the quality of the currently existing playbook structure for installation.
Steps to work on
Variable scoping in AnsibleModules: Nature of scoping, how can we improve our playbooks using them, advantage of using well defined modules vs running commands using the shell module, and similarity with functions
Retain the ansible logs when run through playbook (see serverfault). All ansible modules return stdout and stderror. Please see ansible docs.Including .ansible.cnf in our structure.What happens when hostname is not present in the inventory file?Iterating over groups of hosts in the inventory Mongo DB example.Find out the most frequently used modules, like apt, and the modules used in our yml files and how we can use them better.
Waiting for Gitlab during installation can be done like here.
Iterating over execution nodes to install in ansibleUse Ansible tags to run selective tasks in a playbook
Use Ansible variable and task includes along with tags to create extra execution nodes.
Expected behavior
Simpler ansible playbook files that reduces the complexity of installation.
Additional Information
A good resource for ansible examples is the resource shared by Ansible project.
The Ansible docs should help in finding the answers for almost all the points above.
The text was updated successfully, but these errors were encountered: