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

ansible-inventories/knime#112 Allow external users to access some of MySQL

parent ccd9f981
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@
- set_fact:
db='{{ drupal_domain.db }}'
extra={{ drupal_domain.db.extra|default([]) }}
external={{ drupal_domain.db.external|default([]) }}
external_hosts={{ drupal_domain.db.external_hosts|default([]) }}
tags: always
- name: "Ensure Database"
......@@ -60,3 +62,20 @@
- ['localhost', '127.0.0.1', '::1']
when: item.0.username is defined and item.0.username != 'root'
ignore_errors: true
- name: "Create external MySQL Users"
mysql_user:
user='{{ item.0.username|default("root") }}'
password='{{ item.0.password|default(mysql_root_password|default("root")) }}'
host='{{ item.1 }}'
check_implicit_admin=yes
priv='{{ item.0.priv }}'
login_user='root'
login_password='{{ mysql_root_password|default("root") }}'
login_host='127.0.0.1'
login_port='{{ item.0.port|default('3306') }}'
with_nested:
- '{{ external }}'
- '{{ external_hosts }}'
when: item.0.username is defined and item.0.username != 'root'
ignore_errors: true
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