diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml index afc7db1fd..37c146760 100644 --- a/ansible/roles/kolla-openstack/tasks/config.yml +++ b/ansible/roles/kolla-openstack/tasks/config.yml @@ -101,7 +101,7 @@ - item.0.item.enabled | bool - item.1.path | basename not in item.0.item.ignore | default([]) -- name: Ensure extra configuration files exist +- name: Ensure templated extra configuration files exist template: src: "{{ item.1.path }}" dest: "{{ item.0.item.dest }}/{{ item.1.path | relpath(item.0.item.src) }}" @@ -113,6 +113,21 @@ when: - item.0.item.enabled | bool - item.1.path | basename not in item.0.item.ignore | default([]) + - item.1.path | basename not in item.0.item.untemplated | default([]) + +- name: Ensure untemplated extra configuration files exist + copy: + src: "{{ item.1.path }}" + dest: "{{ item.0.item.dest }}/{{ item.1.path | relpath(item.0.item.src) }}" + mode: 0640 + with_subelements: + - "{{ find_src_result.results }}" + - files + - skip_missing: true + when: + - item.0.item.enabled | bool + - item.1.path | basename not in item.0.item.ignore | default([]) + - item.1.path | basename in item.0.item.untemplated | default([]) - name: Ensure unnecessary extra configuration files are absent file: diff --git a/ansible/roles/swift-rings/files/swift-ring-builder.py b/ansible/roles/swift-rings/files/swift-ring-builder.py index 2499c0262..274bd2a07 100644 --- a/ansible/roles/swift-rings/files/swift-ring-builder.py +++ b/ansible/roles/swift-rings/files/swift-ring-builder.py @@ -120,7 +120,7 @@ def main(): build_path = sys.argv[2] service_name = sys.argv[3] with open(config_path) as f: - config = yaml.load(f) + config = yaml.safe_load(f) build_rings(config, build_path, service_name) diff --git a/ansible/roles/swift-rings/tasks/main.yml b/ansible/roles/swift-rings/tasks/main.yml index c3972b6d8..cb081778a 100644 --- a/ansible/roles/swift-rings/tasks/main.yml +++ b/ansible/roles/swift-rings/tasks/main.yml @@ -6,11 +6,6 @@ # Execute the following commands on the ring build host. - block: - # Facts required for ansible_user_uid and ansible_user_gid. - - name: Gather facts for swift ring build host - setup: - when: not module_setup | default(false) - - name: Ensure Swift ring build directory exists file: path: "{{ swift_ring_build_path }}" @@ -20,6 +15,7 @@ copy: src: swift-ring-builder.py dest: "{{ swift_ring_build_path }}" + register: copy_result - name: Ensure Swift ring builder configuration exists template: @@ -33,14 +29,14 @@ docker_container: cleanup: true command: >- - python {{ swift_container_build_path }}/swift-ring-builder.py + python3 {{ swift_container_build_path }}/swift-ring-builder.py {{ swift_container_build_path }}/{{ item }}-ring.yml {{ swift_container_build_path }} {{ item }} detach: false image: "{{ swift_ring_build_image }}" name: "swift_{{ item }}_ring_builder" - user: "{{ ansible_user_uid }}:{{ ansible_user_gid }}" + user: "{{ copy_result.uid }}:{{ copy_result.gid }}" volumes: - "{{ swift_ring_build_path }}/:{{ swift_container_build_path }}/" with_items: "{{ swift_service_names }}" diff --git a/releasenotes/notes/story-2007297-73f498ef6bc89fe9.yaml b/releasenotes/notes/story-2007297-73f498ef6bc89fe9.yaml new file mode 100644 index 000000000..ba45c673e --- /dev/null +++ b/releasenotes/notes/story-2007297-73f498ef6bc89fe9.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes an issue with copying Swift ring files. See `story 2007297 + `__ for details.