Merge "Don't post reports if there are no reports to post"
This commit is contained in:
commit
f20c52a44b
@ -71,16 +71,19 @@
|
||||
|
||||
- name: set log filename
|
||||
set_fact: puppet_logfile="{{ files.stdout_lines|sort|last }}"
|
||||
when: "{{ files.stdout_lines|length > 0 }}"
|
||||
|
||||
- name: create reports directory
|
||||
file: path=/var/lib/puppet/reports/{{ ansible_fqdn }} owner=root group=root mode=0755 state=directory
|
||||
delegate_to: localhost
|
||||
when: "{{ files.stdout_lines|length > 0 }}"
|
||||
|
||||
- name: fetch file
|
||||
synchronize:
|
||||
mode: pull
|
||||
src: "{{ puppet_logfile }}"
|
||||
dest: /var/lib/puppet/reports/{{ ansible_fqdn }}
|
||||
when: "{{ files.stdout_lines|length > 0 }}"
|
||||
|
||||
- name: post facts
|
||||
puppet_post_puppetdb:
|
||||
@ -90,5 +93,6 @@
|
||||
whoami: "{{ puppet_report_as }}"
|
||||
delegate_to: localhost
|
||||
connection: local
|
||||
when: "{{ files.stdout_lines|length > 0 }}"
|
||||
|
||||
when: puppetdb is defined and puppet_report_as is defined
|
||||
|
Loading…
x
Reference in New Issue
Block a user