Skip to content
Snippets Groups Projects
Commit c2f7a183 authored by Lars Beckers's avatar Lars Beckers
Browse files

mysql: move passwordstore lookup from tasks to variables

parent 22448f7b
No related branches found
No related tags found
No related merge requests found
---
# 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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment