Check that facter.conf is a file
If docker-puppet.py (or container-puppet.py) is run under docker prior
to the facter config being generated, the file is created as a
directory. This causes a failure later when we try to write the file
out.
Change-Id: I9b5a1e06e73b3b4cfc0ebfaeba8f1eb4b5d6fcfe
Closes-Bug: #1852606
(cherry picked from commit 3e25c2c48308694bbae737ad7699fe540ed1a098)
(cherry picked from commit 0606eb6483
)
This commit is contained in:
parent
5f197bb21c
commit
17da3d622b
|
@ -314,6 +314,22 @@
|
|||
setype: svirt_sandbox_file_t
|
||||
selevel: s0
|
||||
recurse: True
|
||||
- name: Check for facter.conf
|
||||
check_mode: false
|
||||
stat:
|
||||
path: "/var/lib/container-puppet/puppetlabs/facter.conf"
|
||||
register: _facter_conf_file
|
||||
# See LP#1852606 for context
|
||||
- name: Remove facter.conf if directory
|
||||
check_mode: false
|
||||
become: true
|
||||
file:
|
||||
path: "/var/lib/container-puppet/puppetlabs/facter.conf"
|
||||
state: absent
|
||||
force: true
|
||||
when:
|
||||
- _facter_conf_file.stat.isdir is defined
|
||||
- _facter_conf_file.stat.isdir
|
||||
- name: Write facter cache config
|
||||
copy:
|
||||
dest: /var/lib/container-puppet/puppetlabs/facter.conf
|
||||
|
|
Loading…
Reference in New Issue