Skip to content

Commit

Permalink
Add better support for multi-OS deployments
Browse files Browse the repository at this point in the history
This change adds a few variables which allow it to consume a repo-server
setup which has releases based on OS and ARCH. The changes require a
deployer to have at least one repo-server per-OS type being deployed.
This means that if a deployer wanted to do a mixed CentOS 7 and Ubuntu
16.04 deployment they'd need at least one repo server in each of OS type
which facilitates the building of wheels for each OS.

Change-Id: Ifd5ff22ae47bc9a2a88c1bbb2632ce48ba5accbf
Closes-Bug: 1641131
Depends-On: I3f36afa307e02a38d73b860fc23ed94a09882c34
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
  • Loading branch information
cloudnull committed Mar 15, 2017
1 parent 27d2754 commit cacf410
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
31 changes: 18 additions & 13 deletions playbooks/inventory/group_vars/all.yml
Expand Up @@ -29,12 +29,26 @@ package_state: "latest"
# Set "/var/log" to be a bind mount to the physical host.
default_bind_mount_logs: true

# Set distro variable
os_distro_version: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version.split('.')[:2] | join('.') }}-{{ ansible_architecture | lower }}"

# Ensure that the package state matches the global setting
ceph_client_package_state: "{{ package_state }}"
galera_client_package_state: "{{ package_state }}"
pip_install_package_state: "{{ package_state }}"
rsyslog_client_package_state: "{{ package_state }}"

## OpenStack source options
openstack_repo_url: "http://{{ internal_lb_vip_address }}:{{ repo_server_port }}"
openstack_repo_git_url: "git://{{ internal_lb_vip_address }}"

# URL for the frozen internal openstack repo.
repo_server_port: 8181
repo_pkg_cache_enabled: true
repo_pkg_cache_port: 3142
repo_pkg_cache_url: "http://{{ internal_lb_vip_address }}:{{ repo_pkg_cache_port }}"
repo_release_path: "{{ openstack_repo_url }}/os-releases/{{ openstack_release }}/{{ os_distro_version }}"

# These are pinned to ensure exactly the same behaviour forever!
# These pins are updated through the sources-branch-updater script
pip_packages:
Expand All @@ -43,23 +57,14 @@ pip_packages:
- wheel==0.29.0

pip_links:
- { name: "openstack_release", link: "{{ openstack_repo_url }}/os-releases/{{ openstack_release }}/" }
- { name: "openstack_release", link: "{{ repo_release_path }}" }
pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}"

# The upper constraints to apply to all pip installations
pip_install_upper_constraints: "{{ openstack_repo_url }}/os-releases/{{ openstack_release }}/requirements_absolute_requirements.txt"
pip_install_upper_constraints: "{{ repo_release_path }}/requirements_absolute_requirements.txt"

# The URL to retrieve the get-pip.py installation script
pip_upstream_url: "{{ (pip_offline_install | bool) | ternary('https://bootstrap.pypa.io/get-pip.py', openstack_repo_url ~ '/os-releases/' ~ openstack_release ~ '/get-pip.py') }}"

## OpenStack source options
# URL for the frozen internal openstack repo.
repo_server_port: 8181
repo_pkg_cache_enabled: true
repo_pkg_cache_port: 3142
repo_pkg_cache_url: "http://{{ internal_lb_vip_address }}:{{ repo_pkg_cache_port }}"
openstack_repo_url: "http://{{ internal_lb_vip_address }}:{{ repo_server_port }}"
openstack_repo_git_url: "git://{{ internal_lb_vip_address }}"
pip_upstream_url: "{{ (pip_offline_install | bool) | ternary('https://bootstrap.pypa.io/get-pip.py', repo_release_path ~ '/get-pip.py') }}"

## kernel modules for specific group hosts
# :param name: name of the kernel module
Expand Down Expand Up @@ -117,7 +122,7 @@ service_ldap_backend_enabled: "{{ keystone_ldap is defined and keystone_ldap.Def

## Base venv configuration
venv_tag: "{{ openstack_release }}"
venv_base_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}"
venv_base_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ os_distro_version }}"

## Aodh
aodh_service_region: "{{ service_region }}"
Expand Down
4 changes: 4 additions & 0 deletions playbooks/inventory/group_vars/repo_all.yml
Expand Up @@ -54,3 +54,7 @@ pip_lock_to_internal_repo: False
#
repo_build_pip_no_binary:
- libvirt-python

# Set the build tag and the repo version
repo_build_release_tag: "{{ openstack_release }}"
repo_build_os_distro_version: "{{ os_distro_version }}"
8 changes: 4 additions & 4 deletions playbooks/repo-build.yml
Expand Up @@ -29,11 +29,12 @@
- name: Prepare group of master repo servers
local_action:
module: "add_host"
name: "{{ groups['repo_servers_' + hostvars[item].ansible_architecture][0] }}"
name: "{{ groups['repo_servers_' + (hostvars[item].ansible_distribution_version.split('.')[:2] | join('.')) + hostvars[item].ansible_architecture][0] }}"
groups: "repo_nodes"
# Process all nodes that don't match the architecture of repo_all[0]
when:
- hostvars[item].ansible_architecture != hostvars[groups['repo_all'][0]].ansible_architecture
when: >
hostvars[item].ansible_architecture != hostvars[groups['repo_all'][0]].ansible_architecture or
(hostvars[item].ansible_distribution_version.split('.')[:2] | join('.')) != (hostvars[groups['repo_all'][0]].ansible_distribution_version.split('.')[:2] | join('.'))
with_items:
- "{{ groups['repo_all'][1:] }}"
tags:
Expand Down Expand Up @@ -123,7 +124,6 @@

roles:
- role: "repo_build"
repo_build_release_tag: "{{ openstack_release }}"
vars_files:
- defaults/repo_packages/openstack_services.yml
vars:
Expand Down
2 changes: 1 addition & 1 deletion playbooks/utility-install.yml
Expand Up @@ -71,7 +71,7 @@
when: ansible_pkg_mgr == 'yum'

- name: Get list of python clients
shell: "curl -s {{ openstack_repo_url }}/os-releases/{{ openstack_release }}/requirements_absolute_requirements.txt | grep client | cut -d'=' -f1"
shell: "curl -s {{ repo_release_path }}/requirements_absolute_requirements.txt | grep client | cut -d'=' -f1"
register: client_list
run_once: true
changed_when: false
Expand Down

0 comments on commit cacf410

Please sign in to comment.