packweb-multi-php: Allow php to contact local mysql with localhost #116

Merged
lpoujol merged 9 commits from mtrossevin/ansible-roles:packweb-multi-php2 into unstable 2020-10-26 09:29:20 +01:00

9 Commits

Author SHA1 Message Date
Mathieu Trossevin 6b89fa18cb
mysql-oracle: Update clients' conf to match server's
continuous-integration/drone/pr Build is failing Details
The socket path was changed in the server configuration, update the
client configuration to match so as not to break anything.
2020-10-23 13:03:23 +02:00
Mathieu Trossevin 71f85a5863
Merge branch 'unstable' into packweb-multi-php2
continuous-integration/drone/pr Build is failing Details
2020-10-20 17:41:36 +02:00
Mathieu Trossevin 2ea4745f93
lxc-php: Update changelog
continuous-integration/drone/pr Build is failing Details
2020-10-20 17:27:34 +02:00
Mathieu Trossevin d7aed91043
packweb-multiphp: Change default configuration for compatibility
continuous-integration/drone/pr Build is failing Details
/var/run is now /run (and it is what is used in the .service file)

Have a default directory configured as bind target so things works by default
2020-10-19 17:33:58 +02:00
Mathieu Trossevin d33b4baef1
Make container restart an handler 2020-10-19 14:16:53 +02:00
Mathieu Trossevin 672cb8a4ef
Merge branch 'unstable' into packweb-multi-php2 2020-10-19 14:13:06 +02:00
Mathieu Trossevin 5e13f8da4e lxc-php: Make mysql socket binding work on fresh install
/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).
2020-06-17 16:06:54 +02:00
Mathieu Trossevin 49b20f9b12 lxc-php: Have mysqld.sock inside of a directory
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.
2020-06-17 16:06:54 +02:00
Mathieu Trossevin 1d9ab0f1f3 Allows using localhost to connect to MySQL in lxc
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.
2020-06-17 16:06:53 +02:00