The behaviour of the `include` module is badly defined (it try to choose
between statically importing the tasks and dynamically including them)
and can cause problems depending on any number of constraints (mostly if
it choose the wrong behaviour).
Replace it with the `import_tasks` (always statically import tasks) unless
the `include` is in a loop in which case we replace it with
`include_tasks` (always dynamically include tasks).
The lxc-php role can be run on a server without mysql. Attempting to
bindmount the mysql socket in such a case cause the lxc container to
fail to start.
This commit add a variable, lxc_php_create_mysql_link defaulting to
false telling ansible if it should bindmount the MySQL socket to the
container.
/var/run/mysqld only exist after mysql is installed, as such the role
lxc-php need to run after the role mysql.
Also only cause a restart of the containers when their configuration has
been changed.
For now socket binding might only work for mysql and not mysql-oracle
(it's default socket seems to be /tmp/mysql.sock).
Bind mount don't seems to work on a file so the default socket is now
always named mysqld.sock and the configurable variable is
php_conf_mysql_socket_dir that define the directory the socket will be
in.
Add 'php_conf_mysql_default_socket' variable to lxc-php role that
configure both the lxc containers and PHP so that a local MySQL database
may be used through localhost.
The PHP containers will automount /var/run/mysqld/mysqld.sock (the
default path to the mysql socket) to the path defined by the variable
'php_conf_mysql_default_socket' which will be the path used by php to
contact MySQL both with mysqli and PDO_MYSQL.
This is a breaking change as lxc-php should now be called for *each* php
containers we want, with the correct lxc_php_version variable.
Current valid values are :
- php56
- php70
- php73
Other changes includes :
- LXC Containers are created by calling lxc as a dependency of the role.
- Relying on lxc_container module to do commands into the container
(instead of the command module)
- PHP 7.3 container is now a Debian Buster container
- All containers will have opensmtpd to relay emails to postfix on the
host system.