I want
The "password generation" step to only run IF the var does not equal "random"
The "debug password generation" step to only run IF the password generation was run.
The "debug password being set" step to only run if the password generation step was skipped
What is happening
All steps are run
My files
playbook.yml
# tasks file for git_deployment
- name: Generate DB login_password
shell: mkpasswd.pl --length=32
args:
creates: /tmp/.dbpwd
register: dbpwd
when: mysql.password != "random"
- name: debug password genreation
debug: var=dbpwd
when: dbpwd is defined
- name: debug password being set
debug: var=mysql
when: { mysql.password != "random" }
- name: create database
mysql_db:
name: ""
state: present
emphasized textrole-tasks.yml
# tasks file for git_deployment
- name: Generate DB login_password
shell: mkpasswd.pl --length=32
args:
creates: /tmp/.dbpwd
register: dbpwd
when: mysql.password != "random"
- name: debug password genreation
debug: var=dbpwd
when: dbpwd is defined
- name: debug password being set
debug: var=mysql
when: { mysql.password != "random" }
- name: create database
mysql_db:
name: ""
state: present
Aucun commentaire:
Enregistrer un commentaire