From 6ec3578a0cf9fb690ba6d414877337f4d955eeab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Fri, 19 Jun 2020 10:30:06 +0200 Subject: [PATCH] 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 --- deployment/ceph-ansible/ceph-osd.yaml | 2 +- .../database/redis-container-puppet.yaml | 28 +++++++++++++------ .../database/redis-pacemaker-puppet.yaml | 12 +++++++- .../nova/nova-libvirt-container-puppet.yaml | 15 ++++++++-- ...ova-migration-target-container-puppet.yaml | 14 +++++++++- .../octavia/octavia-api-container-puppet.yaml | 12 +++++++- 6 files changed, 68 insertions(+), 15 deletions(-) diff --git a/deployment/ceph-ansible/ceph-osd.yaml b/deployment/ceph-ansible/ceph-osd.yaml index 0fccf8fa7e..e30c0f562d 100644 --- a/deployment/ceph-ansible/ceph-osd.yaml +++ b/deployment/ceph-ansible/ceph-osd.yaml @@ -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 diff --git a/deployment/database/redis-container-puppet.yaml b/deployment/database/redis-container-puppet.yaml index 0663a2e16c..f96dfb6176 100644 --- a/deployment/database/redis-container-puppet.yaml +++ b/deployment/database/redis-container-puppet.yaml @@ -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 diff --git a/deployment/database/redis-pacemaker-puppet.yaml b/deployment/database/redis-pacemaker-puppet.yaml index bac98c2113..831ea85fc0 100644 --- a/deployment/database/redis-pacemaker-puppet.yaml +++ b/deployment/database/redis-pacemaker-puppet.yaml @@ -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 diff --git a/deployment/nova/nova-libvirt-container-puppet.yaml b/deployment/nova/nova-libvirt-container-puppet.yaml index 78f3ee9970..738e1cec92 100644 --- a/deployment/nova/nova-libvirt-container-puppet.yaml +++ b/deployment/nova/nova-libvirt-container-puppet.yaml @@ -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 diff --git a/deployment/nova/nova-migration-target-container-puppet.yaml b/deployment/nova/nova-migration-target-container-puppet.yaml index 7021c6e252..c1b8a99d06 100644 --- a/deployment/nova/nova-migration-target-container-puppet.yaml +++ b/deployment/nova/nova-migration-target-container-puppet.yaml @@ -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 diff --git a/deployment/octavia/octavia-api-container-puppet.yaml b/deployment/octavia/octavia-api-container-puppet.yaml index b4ca85fe3f..0ced9777f2 100644 --- a/deployment/octavia/octavia-api-container-puppet.yaml +++ b/deployment/octavia/octavia-api-container-puppet.yaml @@ -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}