Configuration Management
- For any application to work we need some softwares.
- Options for installing necessary softwares and deploying application
Manual
- Administrator will install the necessary softwares
- Admin will deploy the application
- Problems:
- Slow
- Error Prone
Shell/Powershell Scripts
- Create a shell/powershell script to perform deployment
- Problems:
- Multiple ways of doing the same activity. Because it impacts Readability and Maintainability.
- Every script has assumptions
- Scripts are Procedural (How it has to done)
- Example:
- Create a file:
- Create a file using touch command
- files path should be at /home/ubuntu/test.txt
- Create a file:
Configuration Management
- In this user will write the desired state
- Scripts are Declarative (What has to be done)
- The major theme is to maintain desired state.
- CM has an important property call as idempotance
- Example:
- Create a file
- I want an empty file at /home/ubuntu/test.txt
- Create a file
- CM can be done using many tools, some of them are
- Ansible
- Chef
- Salt
- Puppet
- CFEngine
- PowerShell DSC
Architecture of Configuration Management
PUSH
PULL
Ansible Falls under Push based Configuration Management
- Ansible is push based CM tool by default.
- Software requirements of Ansible
- Ansible Control Server:
- Python
- Ansible
- Nodes:
- Python
- Ansible Control Server:
What do the user need to provide to ansible
- Playbook:
- Written in YAML
- YAML is all about data representation
- Inventory:
- List of nodes to be used by Ansible Control