View markdown source on GitHub

Ansible

Contributors

Questions

Objectives

last_modification Published: Oct 27, 2018
last_modification Last Updated: Aug 8, 2024

Configuration Management

Manages the configuration of machines.

Specifies what software is installed, how it is configured

Speaker Notes


Why Configuration Management?

Speaker Notes


Configuration Management goals

Speaker Notes


Ansible

Speaker Notes


Important Terms

Speaker Notes


Inventory File

Defines the systems (called “hosts”) against which Ansible will work.

[webservers]
192.168.0.1
192.168.0.2 ansible_user=ubuntu

[databases]
db_1.example.org ansible_user=root

Speaker Notes


Ansible Module and Tasks

A module is a piece of code that Ansible can execute on a host, collecting return values.

A task is an invocation of single module with its configuration.

---
- copy:
    src: foo.conf
    dest: /etc/foo.conf
    owner: foo
    group: foo
    mode: 0644

- package:
    name: ntpdate
    state: present

Speaker Notes


Role

.pull-left[ A collection of:

]

.pull-right[ with a predefined directory structure:

.
├── defaults
│   └── main.yml
├── files
│   └── cvmfs_wipecache.centos_7
├── handlers
│   └── main.yml
├── meta
│   └── main.yml
├── README.md
├── tasks
│   ├── apache.yml
│   ├── main.yml
│   └── stratumN.yml
├── templates
│   └── stratum1_squid.conf.j2
├── tests
│   ├── inventory
│   └── test.yml
└── vars
    └── main.yml

]

Speaker Notes


Playbook

A YAML file listing a set of tasks and/or roles that should be applied to a group of hosts.

.pull-left[

.pull-right[

- name: CVMFS
  hosts: all
  vars:
    cvmfs_role: client
    galaxy_cvmfs_repos_enabled: true
  roles:
    - geerlingguy.repo-epel
    - galaxyproject.cvmfs

]

Speaker Notes


Vault

$ANSIBLE_VAULT;1.1;AES256
63333238633033313664633437316231323932326531386266636637353037313335613563663934
6639666536653631363739383639633165633337393334630a353233393938646539306362633738
61613439366435336230636561663864323765303663666239613430323534333665636665643964
6537376666323333660a663233343565393166373665366138306661343764623561343634656463
31636265303430623731643766346434323565663436626466353765393465376533376366356463

Speaker Notes


Ansible Philosophies

Speaker Notes


Ansible Galaxy

Speaker Notes


Key Points

Thank you!

This material is the result of a collaborative work. Thanks to the Galaxy Training Network and all the contributors! page logo Tutorial Content is licensed under Creative Commons Attribution 4.0 International License.