Merge "Ensure startup files exist before containers might be started"

This commit is contained in:
Zuul 2021-09-20 17:31:57 +00:00 committed by Gerrit Code Review
commit 5596ac9818
5 changed files with 74 additions and 64 deletions

View File

@ -373,21 +373,23 @@ outputs:
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode|default(omit) }}"
with_items:
- { 'path': /var/log/containers/octavia, 'setype': container_file_t, 'mode': '0750' }
- { 'path': /var/log/containers/httpd/octavia-api, 'setype': container_file_t, 'mode': '0750' }
- { 'path': /run/octavia, 'setype': container_file_t, 'mode': '0755' }
- name: ensure /run/octavia is present upon reboot
copy:
dest: /etc/tmpfiles.d/run-octavia.conf
content: |
d /run/octavia 0755 root root - -
list_concat:
- {get_attr: [OctaviaBase, role_data, host_prep_tasks]}
- - name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode|default(omit) }}"
with_items:
- { 'path': /var/log/containers/octavia, 'setype': container_file_t, 'mode': '0750' }
- { 'path': /var/log/containers/httpd/octavia-api, 'setype': container_file_t, 'mode': '0750' }
- { 'path': /run/octavia, 'setype': container_file_t, 'mode': '0755' }
- name: ensure /run/octavia is present upon reboot
copy:
dest: /etc/tmpfiles.d/run-octavia.conf
content: |
d /run/octavia 0755 root root - -
update_tasks:
list_concat:
- {get_attr: [OctaviaBase, role_data, update_tasks]}

View File

@ -303,7 +303,7 @@ outputs:
- octavia_client_cert_set
- {get_param: OctaviaClientCert}
update_tasks: &ensure_start_up_files
- name: make sure that post-deploy.conf exists before restarting containers on update or upgrade
- name: make sure that post-deploy.conf exists before starting containers
when: step|int == 5
block:
- name: check for octavia post-deploy.conf file
@ -319,3 +319,5 @@ outputs:
when:
- octavia_post_deploy_stat.exists is defined and not octavia_post_deploy_stat.exists
upgrade_tasks: *ensure_start_up_files
host_prep_tasks: *ensure_start_up_files

View File

@ -187,15 +187,17 @@ outputs:
update_tasks: {get_attr: [OctaviaBase, role_data, update_tasks]}
upgrade_tasks: {get_attr: [OctaviaBase, role_data, upgrade_tasks]}
host_prep_tasks:
- name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode }}"
with_items:
- { 'path': /var/log/containers/octavia, 'setype': container_file_t, 'mode': '0750' }
- { 'path': /var/log/containers/octavia-amphorae, 'setype': container_file_t, 'mode': '0750' }
list_concat:
- {get_attr: [OctaviaBase, role_data, host_prep_tasks]}
- - name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode }}"
with_items:
- { 'path': /var/log/containers/octavia, 'setype': container_file_t, 'mode': '0750' }
- { 'path': /var/log/containers/octavia-amphorae, 'setype': container_file_t, 'mode': '0750' }
external_upgrade_tasks:
- when:
- step|int == 1

View File

@ -143,14 +143,16 @@ outputs:
update_tasks: {get_attr: [OctaviaBase, role_data, update_tasks]}
upgrade_tasks: {get_attr: [OctaviaBase, role_data, upgrade_tasks]}
host_prep_tasks:
- name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode }}"
with_items:
- { 'path': /var/log/containers/octavia, 'setype': container_file_t, 'mode': '0750' }
list_concat:
- {get_attr: [OctaviaBase, role_data, host_prep_tasks]}
- - name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode }}"
with_items:
- { 'path': /var/log/containers/octavia, 'setype': container_file_t, 'mode': '0750' }
external_upgrade_tasks:
- when:
- step|int == 1

View File

@ -129,38 +129,40 @@ outputs:
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode }}"
with_items:
- { 'path': /var/log/containers/octavia, 'setype': container_file_t, 'mode': '0750' }
- block:
- name: Ensure packages required for configuring octavia are present for CentOS 7
package:
name:
- python2-neutronclient
- python2-openstackclient
- openssl
state: present
when: ansible_facts['distribution_major_version'] is version(8, '<')
list_concat:
- {get_attr: [OctaviaBase, role_data, host_prep_tasks]}
- - name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode }}"
with_items:
- { 'path': /var/log/containers/octavia, 'setype': container_file_t, 'mode': '0750' }
- block:
- name: Ensure packages required for configuring octavia are present for CentOS 7
package:
name:
- python2-neutronclient
- python2-openstackclient
- openssl
state: present
when: ansible_facts['distribution_major_version'] is version(8, '<')
- name: Ensure packages required for configuring octavia are present for CentOS/RHEL 8
package:
name:
- python3-neutronclient
- python3-openstackclient
- openssl
state: present
when: ansible_facts['distribution_major_version'] is version(8, '>=')
when: {get_param: EnablePackageInstall}
- name: enable virt_sandbox_use_netlink for healthcheck
seboolean:
name: virt_sandbox_use_netlink
persistent: yes
state: yes
- name: Ensure packages required for configuring octavia are present for CentOS/RHEL 8
package:
name:
- python3-neutronclient
- python3-openstackclient
- openssl
state: present
when: ansible_facts['distribution_major_version'] is version(8, '>=')
when: {get_param: EnablePackageInstall}
- name: enable virt_sandbox_use_netlink for healthcheck
seboolean:
name: virt_sandbox_use_netlink
persistent: yes
state: yes
update_tasks: {get_attr: [OctaviaBase, role_data, update_tasks]}
upgrade_tasks: {get_attr: [OctaviaBase, role_data, upgrade_tasks]}
external_upgrade_tasks: