Clean up codestyle in conditionals

Based on some earlier review feedback, add defaults for copy_puppet and
copy_hieradata so that we don't have to check if they are defined. Also,
split the and condition in when to be a list of conditions.

Change-Id: I68bd332bdfae6880b582203161798f709dc45a45
This commit is contained in:
Monty Taylor 2016-01-12 08:27:56 -05:00
parent 368cbb2ba6
commit 6260b48b9e
2 changed files with 6 additions and 2 deletions

View File

@ -54,7 +54,7 @@
dest: "{{ manifest_base }}/hieradata"
state: link
when: copy_hieradata is defined and copy_hieradata
when: copy_hieradata
- block:
- name: copy puppet modules
@ -67,7 +67,9 @@
src: /etc/puppet/modules
dest: /etc/puppet
when: copy_puppet is defined and copy_puppet and manifest_base is defined
when:
- copy_puppet
- manifest_base is defined
- name: run puppet
puppet:

View File

@ -1,4 +1,6 @@
---
# vars file for ansible-puppet
copy_hieradata: false
copy_puppet: false
hieradata: /etc/puppet/hieradata
hieraenvironment: production