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
Branches
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 @@ ...@@ -37,11 +37,9 @@
- name: ensure the mysql root user exists and has the correct password - name: ensure the mysql root user exists and has the correct password
mysql_user: mysql_user:
name: root name: root
# yamllint disable-line rule:line-length password: "{{ mysql_root_password }}"
password: "{{ lookup('passwordstore', 'db/{{ ansible_hostname }}-mysql create=true length=20') }}"
login_user: root login_user: root
# yamllint disable-line rule:line-length login_password: "{{ mysql_root_password }}"
login_password: "{{ lookup('passwordstore', 'db/{{ ansible_hostname }}-mysql create=true length=20') }}"
register: mysql_root_creation_result register: mysql_root_creation_result
no_log: true no_log: true
ignore_errors: true ignore_errors: true
...@@ -52,8 +50,7 @@ ...@@ -52,8 +50,7 @@
- name: initialize the mysql root user - name: initialize the mysql root user
mysql_user: mysql_user:
name: root name: root
# yamllint disable-line rule:line-length password: "{{ mysql_root_password }}"
password: "{{ lookup('passwordstore', 'db/{{ ansible_hostname }}-mysql create=true length=20') }}"
no_log: true no_log: true
when: mysql_root_creation_result|failed when: mysql_root_creation_result|failed
tags: tags:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment