Commit c2f7a183 authored by Lars Beckers's avatar Lars Beckers
Browse files

mysql: move passwordstore lookup from tasks to variables

parent 22448f7b
---
# yamllint disable-line rule:line-length
mysql_root_password: "{{ lookup('passwordstore', 'db/{{ ansible_hostname }}-mysql create=true length=20') }}"
......@@ -37,11 +37,9 @@
- name: ensure the mysql root user exists and has the correct password
mysql_user:
name: root
# yamllint disable-line rule:line-length
password: "{{ lookup('passwordstore', 'db/{{ ansible_hostname }}-mysql create=true length=20') }}"
password: "{{ mysql_root_password }}"
login_user: root
# yamllint disable-line rule:line-length
login_password: "{{ lookup('passwordstore', 'db/{{ ansible_hostname }}-mysql create=true length=20') }}"
login_password: "{{ mysql_root_password }}"
register: mysql_root_creation_result
no_log: true
ignore_errors: true
......@@ -52,8 +50,7 @@
- name: initialize the mysql root user
mysql_user:
name: root
# yamllint disable-line rule:line-length
password: "{{ lookup('passwordstore', 'db/{{ ansible_hostname }}-mysql create=true length=20') }}"
password: "{{ mysql_root_password }}"
no_log: true
when: mysql_root_creation_result|failed
tags:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment