Configuration Management
"Configuration Management refers to the process by which all artifacts relevant to your project, and the relationships between them, are stored, retrieved, uniquely identified, and modified."
Jez Humble
Configuration management strategy
1) Can i exactly reproduce any of my environments, including the version of the operating system, its patch level, the network configuration, the software stack, the applications deployed into it, and their configuration?
2) Can i easily make an incremental change to any of these individual items and deploy the change to any, and all, of my environments?
3) Can I easily see each change that occurred to a particular environment and trace it back to see exactly what the change was, who made it, and when they made it?
4) Is it easy for every member of the team to get information they need, and to make the changes they need to make? Or does the strategy get in the way of efficient delivery, leading to increased cycle time and reduced feedback?
Manage your applications build, deploy, test, and release process by
1) Using version control for everything
2) Managing dependencies
3) Managing the application configuration
4) Use configuration management tooling for software, hardware and infrastructure that the application depends on.
Ansible
WHAT IS ANSIBLE?
Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs.
Being designed for multi-tier deployments since day one, Ansible models your IT infrastructure by describing how all of your systems inter-relate, rather than just managing one system at a time.
It uses no agents and no additional custom security infrastructure, so it’s easy to deploy — and most importantly, it uses a very simple language (YAML, in the form of Ansible Playbooks) that allow you to describe your automation jobs in a way that approaches plain English.
Ansible works by connecting to your nodes and pushing out small programs, called “Ansible Modules” to them. These programs are written to be resource models of the desired state of the system. Ansible then executes these modules (over SSH by default), and removes them when finished.
Your library of modules can reside on any machine, and there are no servers, daemons, or databases required. Typically you’ll work with your favorite terminal program, a text editor, and a version control system to keep track of changes to your content.
Inventory
[webservers]
www1.example.com
www2.example.com
[dbservers]
db0.example.com
db1.example.com
Playbook
---
- hosts: webservers
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: ensure apache is at the latest version
yum: pkg=httpd state=latest
- name: write the apache config file
template: src=/srv/httpd.j2 dest=/etc/httpd.conf
notify:
- restart apache
- name: ensure apache is running
service: name=httpd state=started
handlers:
- name: restart apache
service: name=httpd state=restarted
site.yml
webservers.yml
fooservers.yml
roles/
common/
files/
templates/
tasks/
handlers/
vars/
defaults/
meta/
Roles
webservers/
files/
templates/
tasks/
handlers/
vars/
defaults/
meta/
· If roles/x/tasks/main.yml exists, tasks listed therein will be added to the play
· If roles/x/handlers/main.yml exists, handlers listed therein will be added to the play
· If roles/x/vars/main.yml exists, variables listed therein will be added to the play
· If roles/x/meta/main.yml exists, any role dependencies listed therein will be added to the list of roles (1.3 and later)
· Any copy tasks can reference files in roles/x/files/ without having to path them relatively or absolutely
· Any script tasks can reference scripts in roles/x/files/ without having to path them relatively or absolutely
· Any template tasks can reference files in roles/x/templates/ without having to path them relatively or absolutely
· Any include tasks can reference files in roles/x/tasks/ without having to path them relatively or absolutely
Roles (continued)
Modules
- Cloud Modules
- Commands Modules
- Database Modules
- Files Modules
- Inventory Modules
- Messaging Modules
- Monitoring Modules
- Network Modules
- Notification Modules
- Packaging Modules
- Source Control Modules
- System Modules
- Utilities Modules
- Web Infrastructure Modules
- Windows Modules
Conclusions
Strategy Questions
- Reproduce Envionments
- Incremental Change
- AAA
- Infomation accessable to users
Config Management
By stephenperera
Config Management
- 679