Ensure name consistency for tmpfiles.d configurations

Following change Iaced2ba676a4e4f651c67da082797cc1c1ffccd1, this patch
adds a new task for the update/upgrades steps in order to ensure we're
in a clean state, with consistent names.

It also takes the opportunity to chase down newly added /var/run
mentions.

Change-Id: I9f069332254d057f80e3d25e9f8b734f8a592810
This commit is contained in:
Cédric Jeanneret 2020-06-19 10:30:06 +02:00
parent bd6166c090
commit 6ec3578a0c
6 changed files with 68 additions and 15 deletions

View File

@ -89,7 +89,7 @@ outputs:
- - block:
- name: Check for docker cli
stat:
path: "/var/run/docker.sock"
path: "/run/docker.sock"
register: check_docker_cli
check_mode: false
- name: Set noout flag

View File

@ -221,21 +221,31 @@ outputs:
- { 'path': /run/redis, 'setype': container_file_t }
- name: ensure /run/redis is present upon reboot
copy:
dest: /etc/tmpfiles.d/var-run-redis.conf
dest: /etc/tmpfiles.d/run-redis.conf
content: |
d /run/redis 0755 root root - -
update_tasks:
- name: Ensure redis is uninstalled on container host
- name: redis_container_puppet_redis_pkg_clean
when: step|int == 1
package:
name: redis
state: absent
block: &redis_container_puppet_redis_pkg_clean
- name: Ensure redis is uninstalled on container host
package:
name: redis
state: absent
- name: redis_container_puppet_tmpfile_cleanup
when: step|int == 1
block: &redis_container_puppet_tmpfile_cleanup
- name: remove old tmpfiles.d config
file:
path: /etc/tmpfiles.d/var-run-redis.conf
state: absent
upgrade_tasks:
- name: Ensure redis is uninstalled on container host
- name: redis_container_puppet_redis_pkg_clean
when: step|int == 1
package:
name: redis
state: absent
block: *redis_container_puppet_redis_pkg_clean
- name: redis_container_puppet_tmpfile_cleanup
when: step|int == 1
block: *redis_container_puppet_tmpfile_cleanup
external_upgrade_tasks:
- when:
- step|int == 1

View File

@ -248,7 +248,7 @@ outputs:
- { 'path': /run/redis, 'setype': container_file_t }
- name: ensure /run/redis is present upon reboot
copy:
dest: /etc/tmpfiles.d/var-run-redis.conf
dest: /etc/tmpfiles.d/run-redis.conf
content: |
d /run/redis 0755 root root - -
deploy_steps_tasks:
@ -275,6 +275,13 @@ outputs:
tripleo_ha_wrapper_puppet_tags: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
tripleo_ha_wrapper_puppet_debug: {get_param: ConfigDebug}
update_tasks:
- name: redis_pacemaker_puppet_tmpfile_cleanup
when: step|int == 1
block: &redis_pacemaker_puppet_tmpfile_cleanup
- name: Clean old tmpfile configuration
file:
path: /etc/tmpfiles.d/var-run-redis.conf
state: absent
- name: Tear-down non-HA redis container
when:
- step|int == 1
@ -323,6 +330,9 @@ outputs:
tripleo_ha_wrapper_minor_update: true
upgrade_tasks:
- name: redis_pacemaker_puppet_tmpfile_cleanup
when: step|int == 1
block: *redis_pacemaker_puppet_tmpfile_cleanup
- name: Tear-down non-HA redis container
when:
- step|int == 0

View File

@ -901,7 +901,7 @@ outputs:
when: libvirt_installed.rc == 0
- name: ensure /run/libvirt is present upon reboot
copy:
dest: /etc/tmpfiles.d/var-run-libvirt.conf
dest: /etc/tmpfiles.d/run-libvirt.conf
content: |
d /run/libvirt 0755 root root - -
metadata_settings:
@ -927,4 +927,15 @@ outputs:
network: {get_param: [ServiceNetMap, NovaLibvirtNetwork]}
type: node
- null
upgrade_tasks: []
upgrade_tasks:
- name: nova_libvirt_container_tmpfile_cleanup
when: step|int == 1
block: &nova_libvirt_container_tmpfile_cleanup
- name: Remove old tmpfiles.d config
file:
path: /etc/tmpfiles.d/var-run-libvirt.conf
state: absent
update_tasks:
- name: nova_libvirt_container_tmpfile_cleanup
when: step|int == 1
block: *nova_libvirt_container_tmpfile_cleanup

View File

@ -156,7 +156,7 @@ outputs:
- { 'path': /run/libvirt, 'setype': virt_var_run_t }
- name: ensure /run/libvirt is present upon reboot
copy:
dest: /etc/tmpfiles.d/var-run-libvirt.conf
dest: /etc/tmpfiles.d/run-libvirt.conf
content: |
d /run/libvirt 0755 root root - -
docker_config:
@ -197,3 +197,15 @@ outputs:
- container_cli == 'podman'
- not container_healthcheck_disabled
- step|int == 5
update_tasks:
- name: nova_migration_target_tmpfile_cleanup
when: step|int == 1
block: &nova_migration_target_tmpfile_cleanup
- name: Remove old tmpfiles.d config
file:
path: /etc/tmpfiles.d/var-run-libvirt.conf
state: absent
upgrade_tasks:
- name: nova_migration_target_tmpfile_cleanup
when: step|int == 1
block: *nova_migration_target_tmpfile_cleanup

View File

@ -397,10 +397,17 @@ outputs:
- { 'path': /run/octavia, 'setype': container_file_t, 'mode': '0755' }
- name: ensure /run/octavia is present upon reboot
copy:
dest: /etc/tmpfiles.d/var-run-octavia.conf
dest: /etc/tmpfiles.d/run-octavia.conf
content: |
d /run/octavia 0755 root root - -
update_tasks:
- name: octavia_api_tmpfile_cleanup
when: step|int == 1
block: &octavia_api_tmpfile_cleanup
- name: octavia_api_tmpfile_cleanup
file:
path: /etc/tmpfiles.d/var-run-octavia.conf
state: absent
- name: Set internal tls variable
set_fact:
internal_tls_enabled: {get_param: EnableInternalTLS}
@ -436,6 +443,9 @@ outputs:
systemd:
daemon-reload: yes
upgrade_tasks:
- name: octavia_api_tmpfile_cleanup
when: step|int == 1
block: *octavia_api_tmpfile_cleanup
- name: Set internal tls variable
set_fact:
internal_tls_enabled: {get_param: EnableInternalTLS}