Use ansible role to create puppet cache

Change-Id: Id1b449cc260320879e3d08d60d3cc15aa95e7780
Depends-On: https://review.opendev.org/#/c/693755/
This commit is contained in:
Alex Schultz 2019-11-11 15:59:12 -07:00
parent f2a95da347
commit 9931decca0

View File

@ -118,47 +118,11 @@
# check_mode to "no".
# https://bugzilla.redhat.com/show_bug.cgi?id=1738529
- name: Pre-cache facts for container-puppet.py
check_mode: no
include_role:
name: tripleo-puppet-cache
tags:
- container_config
- container_config_tasks
block:
- name: Create puppet caching structures
file:
path: /var/lib/container-puppet/puppetlabs
state: directory
setype: svirt_sandbox_file_t
selevel: s0
recurse: True
- name: Write facter cache config
copy:
dest: /var/lib/container-puppet/puppetlabs/facter.conf
content: |
facts : {
ttls: [
{ "kernel" : 8 hour },
{ "memory" : 8 hour },
{ "networking" : 8 hour },
{ "operating system" : 8 hour },
{ "processor" : 8 hour },
]
}
setype: svirt_sandbox_file_t
selevel: s0
- name: Cleanup facter cache if exists
file:
path: /opt/puppetlabs/facter
state: absent
ignore_errors: True
- name: Pre-cache facts
command: facter --config /var/lib/container-puppet/puppetlabs/facter.conf
no_log: True
ignore_errors: True
- name: Sync cached facts
synchronize:
src: /opt/puppetlabs/
dest: /var/lib/container-puppet/puppetlabs/
delegate_to: "{{ inventory_hostname }}"
######################################
# Generate config via container-puppet.py