- Source: download tar.gz or git?
- Binary: download or via package manager?
- Permission
- Customized configuration?
- Register variables
- Conditions (
when
in this example) - Handlers (to be discussed later in Lab #05)
Copy configuration files...
- as-is
- variable substitution with Jinja2 template system
See: Ansible official document - Best Practices
-
Network modules / get_url: Downloads files from HTTP, HTTPS, or FTP to node.
-
Files modules / unarchive: Unpacks an archive after (optionally) copying it from the local machine.
-
Commands modules / command: Executes a command on a remote node.
-
Files modules / template: Templates a file out to a remote server.
-
File modules / lineinfile: Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression.
-
System modules / service: Manage services.
Pursue for idempotence with handlers:
- Handler for "reload nginx"
- Handler for "reload php-fpm"
Full details are to be discussed later in Lab #05.