Merge "Allow mysql_username and mysql_password to be passed via env var."

This commit is contained in:
Jenkins 2016-03-18 11:41:46 +00:00 committed by Gerrit Code Review
commit 6e56f0742f
2 changed files with 17 additions and 0 deletions

View File

@ -136,6 +136,16 @@
write_priv: ".*" write_priv: ".*"
read_priv: ".*" read_priv: ".*"
no_log: true no_log: true
- name: "Set mysql_username if environment variable mysql_user is set"
set_fact:
mysql_username: "{{ lookup('env', 'mysql_user') }}"
when: lookup('env', 'mysql_user') | length > 0
no_log: true
- name: "Set mysql_password if environment variable mysql_pass is set"
set_fact:
mysql_password: "{{ lookup('env', 'mysql_pass') }}"
when: lookup('env', 'mysql_pass') | length > 0
no_log: true
- name: "MySQL - Creating DB" - name: "MySQL - Creating DB"
mysql_db: mysql_db:
name: "ironic" name: "ironic"

View File

@ -0,0 +1,7 @@
---
features:
- Add support for passing a Mysql username and password
via environment variables mysql_user for username and
mysql_pass for password. Useful for cases where Mysql
server may be existing and have usernames with password
already set.