Running the playbooks

Roles selection playbooks

The roles selection playbooks let you install, check, backup, restore and uninstall, a selection of one or more roles. They are described below.

Install the simple web site

This is the simplest example:

ROLE=website-simple ansible-playbook install.yml

This will install a simple static web site using nginx, with the certificates automatically renewed using LetsEncrypt.

Running multiple roles

The following command will install both autoconfig and autodiscover to the target system, two roles to pusblish necessary information for certain email clients like Mozilla Thunderbird or Microsoft Outlook:

ROLE=autoconfig,autodiscover ansible-playbook install.yml

Running multiple playbooks

Very useful when developing. For instance, the following command will run the uninstallation, installation and self-check tasks for the role website-simple in one command only:

ROLE=website-simple ansible-playbook uninstall.yml install.yml check.yml

Combining both

Installing two roles, then running the checking tasks on each of them.

ROLE=autoconfig,autodiscover ansible-playbook install.yml check.yml

Full playbooks

The full playbooks, install-version.yml and check-version.yml are respectively installing and checking the version you specify from the command line. For instance, to fully install and check the small variant:

ansible-playbook -e version=small install-version.yml checking-version.yml

Other options

Development

Marking your system as a development one.

system:
  devel: true

Each role may act differently when a system is marked as development. For instance, the DNS server or the proxy logs will be more verbose. This is often implemented in the configuration files:

LogLevel {{ system.devel | ternary("Info", "Warning") }}

Also, when running the playbooks, the generated credentials will be shown on the console.

Debugging

This is useful when you want to debug a live system, but not a development one. In this mode, the generated credentials will not be shown on the console by default.

system:
  debug: true

Again, each role may implement more verbose options when the system is marked with this flag set to true. For instance, dovecot, postfix or ejabberd logs are more verbose.

# loglevel: Verbosity of log files generated by ejabberd
loglevel: '{{ system.debug | ternary("debug", "info") }}'

You can change the value, and safely redeploy any of this role. You don’t need to uninstall, just redeploy one role again. Once you have finish debugging, set the flag to false, and redeploy the same role again. Here an example with ejabberd:

ROLE=ejabberd ansible-playbook install.yml