summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2016-09-16 14:34:30 -0700
committerMonty Taylor <mordred@inaugust.com>2016-10-01 08:11:13 -0700
commitfccf47a713471f2bf576ecf01cab36e4dd3f1bd1 (patch)
tree0ab647a3f2b3cd971149c631f1b0b8860c42ffcf
parent8cc1cd9126b2edb360dd0b3182dd9c283aabc0a3 (diff)
Add debug argument
To run puppet in debug mode. Change-Id: I00baef254db2f9eaee23fb9eacded8efc5a2afc4
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: Paul Belanger <pabelanger@redhat.com> Code-Review+2: Spencer Krum <nibz@spencerkrum.com> Workflow+1: James E. Blair <corvus@inaugust.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 04 Oct 2016 21:18:22 +0000 Reviewed-on: https://review.openstack.org/371811 Project: openstack-infra/ansible-role-puppet Branch: refs/heads/master
-rw-r--r--library/puppet9
-rw-r--r--tasks/main.yml1
2 files changed, 10 insertions, 0 deletions
diff --git a/library/puppet b/library/puppet
index 3130686..3f53f96 100644
--- a/library/puppet
+++ b/library/puppet
@@ -79,6 +79,12 @@ options:
79 required: false 79 required: false
80 default: false 80 default: false
81 version_added: "2.1" 81 version_added: "2.1"
82 debug:
83 description:
84 - Whether puppet should be run in debug mode
85 required: false
86 default: false
87 version_added: "2.1"
82 88
83requirements: [ puppet ] 89requirements: [ puppet ]
84author: "Monty Taylor (@emonty)" 90author: "Monty Taylor (@emonty)"
@@ -133,6 +139,7 @@ def main():
133 facter_basename=dict(default='ansible'), 139 facter_basename=dict(default='ansible'),
134 environment=dict(required=False, default=None), 140 environment=dict(required=False, default=None),
135 noop=dict(required=False, default=False, type='bool'), 141 noop=dict(required=False, default=False, type='bool'),
142 debug=dict(required=False, default=False, type='bool'),
136 ), 143 ),
137 supports_check_mode=True, 144 supports_check_mode=True,
138 mutually_exclusive=[ 145 mutually_exclusive=[
@@ -204,6 +211,8 @@ def main():
204 cmd += " --noop" 211 cmd += " --noop"
205 else: 212 else:
206 cmd += " --no-noop" 213 cmd += " --no-noop"
214 if p['debug']:
215 cmd += " --debug"
207 rc, stdout, stderr = module.run_command(cmd) 216 rc, stdout, stderr = module.run_command(cmd)
208 217
209 if rc == 0: 218 if rc == 0:
diff --git a/tasks/main.yml b/tasks/main.yml
index adac5d1..0836240 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -65,6 +65,7 @@
65 logdest: "{{ puppet_logdest|default(omit) }}" 65 logdest: "{{ puppet_logdest|default(omit) }}"
66 environment: "{{ puppet_environment|default(omit) }}" 66 environment: "{{ puppet_environment|default(omit) }}"
67 noop: "{{ puppet_noop|default(omit) }}" 67 noop: "{{ puppet_noop|default(omit) }}"
68 debug: "{{ puppet_debug|default(omit) }}"
68- always: 69- always:
69 - name: find logs 70 - name: find logs
70 shell: "ls -tr /var/lib/puppet/reports/{{ ansible_fqdn }}/*_puppetdb.json" 71 shell: "ls -tr /var/lib/puppet/reports/{{ ansible_fqdn }}/*_puppetdb.json"