Resolve random node selection in repo build
In some cases the multiple archetecture support in a multi-node cloud will select nodes incapable of sync'ing data outside of themselves as primary build targets. This patch ensures that a known group of "repo_nodes" is created at run-time and consists of unique hosts with unique archetectures provided the hostname does not match the first node within the "repo_all" group. Closes-Bug: #1633784 Change-Id: Ifdfabf3b2ef147d287263f2c79c676267fbdea3c Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
4bbb23a141
commit
cf0d302d56
@ -21,12 +21,22 @@
|
|||||||
key: repo_servers_{{ ansible_architecture }}
|
key: repo_servers_{{ ansible_architecture }}
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
- local_action:
|
||||||
|
module: "add_host"
|
||||||
|
name: "{{ item }}"
|
||||||
|
groups: "repo_nodes"
|
||||||
|
when:
|
||||||
|
- item != groups['repo_all'][0]
|
||||||
|
with_items: "{{ groups['repo_servers_' + ansible_architecture][0] }}"
|
||||||
tags:
|
tags:
|
||||||
- repo-build
|
- repo-build
|
||||||
|
|
||||||
# repo_all[0] is built last to ensure it has all build artifacts for final indexing
|
# repo_all[0] is built last to ensure it has all build artifacts for final indexing
|
||||||
|
# The repo_nodes group will be populated with the first node of any other system running
|
||||||
|
# different architectures. This group is a meta group created in the previous play and
|
||||||
|
# will not be found within inventory.
|
||||||
- name: Build new repo packages for a given release
|
- name: Build new repo packages for a given release
|
||||||
hosts: repo_all[1:],repo_all[0]
|
hosts: repo_nodes, repo_all[0]
|
||||||
gather_facts: "{{ gather_facts | default(True) }}"
|
gather_facts: "{{ gather_facts | default(True) }}"
|
||||||
user: root
|
user: root
|
||||||
serial: 1
|
serial: 1
|
||||||
@ -37,9 +47,6 @@
|
|||||||
- name: Load local packages
|
- name: Load local packages
|
||||||
debug:
|
debug:
|
||||||
msg: "Loading Packages"
|
msg: "Loading Packages"
|
||||||
when:
|
|
||||||
- "groups['repo_servers_{{ ansible_architecture }}'] | length > 0"
|
|
||||||
- "inventory_hostname == groups['repo_servers_{{ ansible_architecture }}'][0]"
|
|
||||||
with_py_pkgs: "{{ pkg_locations }}"
|
with_py_pkgs: "{{ pkg_locations }}"
|
||||||
register: local_packages
|
register: local_packages
|
||||||
tags:
|
tags:
|
||||||
@ -108,9 +115,6 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: "repo_build"
|
- role: "repo_build"
|
||||||
repo_build_release_tag: "{{ openstack_release }}"
|
repo_build_release_tag: "{{ openstack_release }}"
|
||||||
when:
|
|
||||||
- "groups['repo_servers_{{ ansible_architecture }}'] | length > 0"
|
|
||||||
- "inventory_hostname == groups['repo_servers_{{ ansible_architecture }}'][0]"
|
|
||||||
vars_files:
|
vars_files:
|
||||||
- defaults/repo_packages/openstack_services.yml
|
- defaults/repo_packages/openstack_services.yml
|
||||||
vars:
|
vars:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user