Don't post reports if there are no reports to post
If we don't produce any reports, don't post them. Change-Id: I06f0bf47a1761f90118ad45a99e33f112699a4c7
This commit is contained in:
parent
403053534b
commit
3408a8f0f5
@ -70,16 +70,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:
|
||||
@ -89,5 +92,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