Simple Tips : Ansible Series : P2
Mustapha JDAD
Solutions Architect ??Cloud/AWS ??On-promise ??Diverse Background ??Tech Mentor ??Continuous Learning & Improvement
P2 : How does Ansible works ?
Ansible works in "Desired State".... It will be able to identify actions to proceed or not according to this desired state.
It works by push mode :
- Ansible is installed on a Master node (or on a basic workstation)
- Connects itself in SSH Mode to all the Targets (managed servers),
- Push and Execute on them the concerned Modules
- Finally Delete these Modules at the end of process.
by chart ?
Configuration File :
A File that contains all ansible settings
- The default path : /etc/ansible/ansible.cfg
- it's called ansible.cfg
- Contain all the default values : log paths,debugging colors,plugins.....etc.
Inventory :
Ansible requires an inventory which contains the list of all the managed servers.
- The defaut path : /etc/ansible/hosts
- 2 types of inventory :
- Static : a simple txt file.
- Dynamic : CMDB as an exmaple.
- 5 Types of declaration : Local, IP list, Groups, Subgroups, Parent:Children.
Playbook :
A Yaml file that contains one or several play,each play is composed from one or several tasks
- The default path : /etc/ansible/roles.
- Playbook are files written in YAML with the extension *.yml
- Playbook contain one or several tasks but at least one task to be lunched.
- Every task should be completed before moving to the next one.
Master node :
The machine that control all the managed servers using ssh.
- The machine where ansible should be installed (package and dependecies).
- The connection ssh should be open from Master to Node but not the opposit.
- It must be based on linux !
- the Config file and Inventory should be configured only on this machine.
The next chapter will cover : How to setup an environment !!
The Main Goal is To Make it easy for Others!