They are designed so they can also be used individually:
- to keep a machine up to date with configuration changes, use
deploy-config.yml
. - to keep a machine up to date with new version of applications not
managed by package managers,
host-setup.yml
. - when new users must be create on a machine,
user-setup.yml
.
roles/
directory or if you want to use the
directories meant to store various data used by the playbooks.
This has the following caracteristics:
- Stay updated with my modifications.
- Submit patches to this repository.
- Store your own modifcations in your repository
ansible-playbook -i <inventory> grand-setup.yml
<inventory>
, an inventory file listing machines impacted by the playbook.
This playbook call all the other playbooks:
- to setup hosts.
- create one user and install its applications on each host.
- deploy the application’s configuration in the user’s
$HOME
directory of each host.
ansible-playbook -i <inventory> host-setup.yml
<inventory>
, an inventory file listing machines impacted by the playbook.
This playbook is in charge of:
- Installing the softwares
- Updating the softwares
It use both the package manager or by compiling the sources from a git repositories. It is to be used to update applications not maintained by package managers
ansible-playbook -i <inventory> user-setup.yml
<inventory>
, an inventory file listing machines impacted by the playbook.
It allows to create new users and ensure that a user has the
minimum tree structure in its $HOME
directory.
ansible-playbook -i <inventory> deploy-config.yml
<inventory>
, an inventory file listing machines impacted by the playbook.
It ensures that the configuration for a set of applications are
deployed in a user’s $HOME
directory and are at their latest
version.
It is composed of the following main structures:
group_vars/
, should be used to define variables used by the playbooks for specific host groups.host_vars/
, should be used to define variables used for specific hosts.inventories/
, should be used to store inventory filesroles/
, contains the bulk of the ansible commands used by the playbooks.users/
, should be used to store the configuration related to each user to be deployed.
The other directories are not used currently.
If this directory is used, it must contain one YAML file for each group specified in inventory files. The files must have the same name has the group they belong to.A YAML file specifies the list of users to be created and maintained up to date in addition to the set of applications for a host to be functional.
The host-group-template.yml
file, is an example file and contains
all the instructions to create such file.
group_vars/
, but in this directory each file is linked to
one host. Hence, each YAML file must be name like the host that
will use it.
The host-template.yml
file, is an example file and contains
all the instructions to create such file.
A few example files are present in this directory, anyway.
If you simply want to use my setup, you shouldn’t have to modify the content of this directory.This is where the magic happens. each directory defines the rules to treat an aspect of the host management.
The common/
directory contains all the rules that can be reused,
like installing a particular software using a package manager.
The other directories treat a particular cases of software and configuration deployment.
It can be used to store the files containing the data defining users’ software set, the related configuration and more generally there definition in the host’s system.The file user-template.yml
contains all the documentation
describing the structure of such file.
The file names must match the user’s names defined in host_vars/
and group_vars/
files.
<user-config.yml>
, it is possible to limit the
tasks of the playbooks.
The playbooks perform the following steps:
- Update the local copy of the repository containing the configuration.
- Create the user and its basic directory structure, if a new user is requested
- For each application configured, execute its role
For each application’s configuration, an ansible role is defined. Each role perform the following tasks:
- Install the software related to the configuration, if requested
- If deployment of the configuration is requested:
- Clean the user directory of any existing configuration for the application
- Deploy the last version of the configuration available
- Roland Everaert
Copyright (c) 2020 Roland Everaert