Open hansmi opened 6 years ago
Added support for omitting template arguments in 1f430f737ecd027c2ecd52eac71d407915b052e6. Please note that the module is currently not idempotent when using generators since each template instantiation creates a different value. I currently use something like this to achieve idempotency with generated arguments:
- name: Create MySQL password
shell: "umask 077 && dd if=/dev/urandom bs=15 count=1 | base64 -w0 > /etc/origin/master/zabbix-monitoring-mysql-password.txt"
args:
creates: /etc/origin/master/zabbix-monitoring-mysql-password.txt
- name: Load MySQL password into variable
slurp:
src: /etc/origin/master/zabbix-monitoring-mysql-password.txt
register: mysql_password
- name: Instantiate Zabbix monitoring template
openshift_resource:
arguments:
MYSQL_PASSWORD: "{{ mysql_password['content'] | b64decode }}"
I have a template with default values for its parameters, i.e.:
When the value is not set in Ansible I intend to omit the values and automatically generating a value:
I'd expect
WEB_USERNAME
to be omitted. What happens, however, is that the variable is set to the omit placeholder (__omit_place_holder__…
):