Skip to content
Snippets Groups Projects
Commit fa8e67da authored by jurgenhaas's avatar jurgenhaas
Browse files

General improvements

parent 26b2137f
No related branches found
No related tags found
No related merge requests found
......@@ -180,7 +180,7 @@
- name: "Create MySQL User"
mysql_user:
user='{{ item.0.db.username|default("root") }}'
user='{{ item.0.db.username }}'
password='{{ item.0.db.password|default(mysql_root_password) }}'
host='{{ item.1 }}'
check_implicit_admin=yes
......@@ -188,6 +188,7 @@
with_nested:
- '{{ drupal.domains }}'
- ['localhost', '127.0.0.1', '::1', '{{ inventory_hostname }}']
when: item.0.db.username is defined and item.0.db.username != 'root'
notify: "MySQL | Restart MySQL"
- name: "Set Extended Permissions"
......
......@@ -7,8 +7,13 @@ $databases = array (
'database' => '{{ item.db.name }}',
'username' => '{{ item.db.username|default("root") }}',
'password' => '{{ item.db.password|default(mysql_root_password) }}',
'host' => '{{ item.db.host|default("127.0.0.1") }}',
{% if hostvars[item.db.host|default(inventory_hostname)]["ssh_tunnel_ports"] is defined %}
'host' => '127.0.0.1',
'port' => '{{ hostvars[item.db.host|default(inventory_hostname)]["ssh_tunnel_ports"][0]["local"] }}',
{% else %}
'host' => '{{ item.db.host|default("127.0.0.1") }}',
'port' => '{{ item.db.port|default("3306") }}',
{% endif %}
),
),
{% for db in item.db.extra|default([]) %}
......@@ -18,8 +23,13 @@ $databases = array (
'database' => '{{ db.name }}',
'username' => '{{ db.username|default(item.db.username|default("root")) }}',
'password' => '{{ db.password|default(item.db.password|default(mysql_root_password)) }}',
'host' => '{{ item.db.host|default("127.0.0.1") }}',
{% if hostvars[item.db.host|default(inventory_hostname)]["ssh_tunnel_ports"] is defined %}
'host' => '127.0.0.1',
'port' => '{{ hostvars[item.db.host|default(inventory_hostname)]["ssh_tunnel_ports"][0]["local"] }}',
{% else %}
'host' => '{{ item.db.host|default("127.0.0.1") }}',
'port' => '{{ item.db.port|default("3306") }}',
{% endif %}
),
),
{% endfor %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment