forked from evolix/ansible-roles
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.
This commit is contained in:
parent
1d9ab0f1f3
commit
49b20f9b12
|
@ -8,7 +8,8 @@ php_conf_allow_url_fopen: "Off"
|
||||||
php_conf_disable_functions: "exec,shell-exec,system,passthru,popen"
|
php_conf_disable_functions: "exec,shell-exec,system,passthru,popen"
|
||||||
|
|
||||||
# Allows accessing a local mysql database using localhost
|
# Allows accessing a local mysql database using localhost
|
||||||
php_conf_mysql_default_socket: Null
|
php_conf_mysql_socket_dir: Null
|
||||||
|
php_conf_mysql_default_socket: "{{ php_conf_mysql_socket_dir }}/mysqld.sock"
|
||||||
|
|
||||||
lxc_php_version: Null
|
lxc_php_version: Null
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,5 @@
|
||||||
lxc_container:
|
lxc_container:
|
||||||
name: "{{ lxc_php_version }}"
|
name: "{{ lxc_php_version }}"
|
||||||
container_config:
|
container_config:
|
||||||
- "lxc.mount.entry = /var/run/mysqld/mysqld {{ php_conf_mysql_default_socket | replace('/', '', 1) }} none bind,create=file 0 0"
|
- "lxc.mount.entry = /var/run/mysqld {{ php_conf_mysql_socket_dir | replace('/', '', 1) }} none bind,create=dir 0 0"
|
||||||
state: restarted
|
when: php_conf_mysql_socket_dir is string
|
||||||
when: php_conf_mysql_default_socket is string
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ html_errors = {{ php_conf_html_errors }}
|
||||||
allow_url_fopen = {{ php_conf_allow_url_fopen }}
|
allow_url_fopen = {{ php_conf_allow_url_fopen }}
|
||||||
disable_functions = {{ php_conf_disable_functions }}
|
disable_functions = {{ php_conf_disable_functions }}
|
||||||
|
|
||||||
{% if php_conf_mysql_default_socket %}
|
{% if php_conf_mysql_socket_dir %}
|
||||||
[Pdo_mysql]
|
[Pdo_mysql]
|
||||||
pdo_mysql.default_socket = {{ php_conf_mysql_default_socket }}
|
pdo_mysql.default_socket = {{ php_conf_mysql_default_socket }}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue