Merge "Fix deploy-env role"

This commit is contained in:
Zuul 2023-10-27 21:48:05 +00:00 committed by Gerrit Code Review
commit 1fcb3f1b23
3 changed files with 28 additions and 25 deletions

View File

@ -11,20 +11,6 @@
# limitations under the License. # limitations under the License.
--- ---
- hosts: all
become: true
tasks:
- name: Configure /etc/hosts for buildset_registry to workaround docker not understanding ipv6 addresses
lineinfile:
path: /etc/hosts
state: present
regex: "^{{ buildset_registry.host }}\tzuul-jobs.buildset-registry$"
line: "{{ buildset_registry.host }}\tzuul-jobs.buildset-registry"
insertafter: EOF
when:
- buildset_registry is defined
- buildset_registry.host | ipaddr
- hosts: primary - hosts: primary
tasks: tasks:
- name: Override images - name: Override images
@ -32,17 +18,10 @@
vars: vars:
work_dir: "{{ zuul.project.src_dir }}" work_dir: "{{ zuul.project.src_dir }}"
block: block:
- name: Set buildset_registry alias variable when using ip - name: Buildset registry alias
set_fact: include_role:
buildset_registry_alias: zuul-jobs.buildset-registry name: deploy-env
when: tasks_from: buildset_registry_alias
- buildset_registry.host | ipaddr
- name: Set buildset_registry alias variable when using name
set_fact:
buildset_registry_alias: "{{ buildset_registry.host }}"
when:
- not ( buildset_registry.host | ipaddr )
- name: Print zuul - name: Print zuul
debug: debug:

View File

@ -0,0 +1,13 @@
---
- name: Set buildset_registry alias variable when using ip
set_fact:
buildset_registry_alias: zuul-jobs.buildset-registry
when:
- buildset_registry.host | ipaddr
- name: Set buildset_registry alias variable when using name
set_fact:
buildset_registry_alias: "{{ buildset_registry.host }}"
when:
- not ( buildset_registry.host | ipaddr )
...

View File

@ -87,6 +87,17 @@
include_tasks: include_tasks:
file: buildset_registry_alias.yaml file: buildset_registry_alias.yaml
- name: Configure /etc/hosts for buildset_registry to workaround docker not understanding ipv6 addresses
lineinfile:
path: /etc/hosts
state: present
regex: "^{{ buildset_registry.host }}\tzuul-jobs.buildset-registry$"
line: "{{ buildset_registry.host }}\tzuul-jobs.buildset-registry"
insertafter: EOF
when:
- buildset_registry is defined
- buildset_registry.host | ipaddr
- name: Write buildset registry TLS certificate - name: Write buildset registry TLS certificate
copy: copy:
content: "{{ buildset_registry.cert }}" content: "{{ buildset_registry.cert }}"