Cleanup pip install role

With the change in openstack_hosts repo, we can remove
duplications in the pip_install role.

Depends-On: I541287f906a143ed79553c69e1a9e39ee38dc8dc
Change-Id: I1afc143579689a690eddbbf2423a4cd0501f9688
This commit is contained in:
Jean-Philippe Evrard 2017-10-26 14:03:13 +01:00 committed by Kevin Carter (cloudnull)
parent 06bf2a9e07
commit a6216fa4a8
9 changed files with 0 additions and 367 deletions

View File

@ -13,45 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
uca_enable: True
uca_apt_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
# If you want to use your own keys for UCA or RDO (instead of ubuntu or
# CentOS defaults), please define user_external_repo_key_list, a list
# of dictionaries, each dict with keys/values corresponding to the
# ansible module arguments for your distribution.
#
# For CentOS you'd define the following:
#user_external_repo_keys_list:
# - key: https://my-repo.example.com/signing-key.asc
# You could also use key: <keyid> from a keyserver, see ansible rpm_key doc.
# Validate cert option from the module is also supported.
# In CentOS, refusing to use the RDO package also forces you to add your own
# repository. See below to know how to include your own repository.
#
# For Ubuntu, you'd define the following:
#user_external_repo_keys_list:
# - url: https://my-repo.example.com/signing-key.asc
# This leverages apt_key module, and passes the id, keyserver, and url argument.
# Therefore, you can ensure the id of the key you want to import with id: <keyid>
# or replace the source url with a keyserver.
user_external_repo_keys_list: []
# If you have defined another set of keys you want to include, the chances are
# high you want to give also your own repository.
# For CentOS, define the following list +key/values:
#user_external_repos_list:
# - name: "mymirror"
# baseurl: "http://mymirrorurl/baseurl/"
#See also gpgcheck, gpgkey, description of the Ansible yum_repository module
# For Ubuntu, define something like the following:
#user_external_repos_list:
# - repo: "deb http://mymirrorurl/ubuntu/ xenial main"
# filename: "mymirror"
# If your mirror includes UCA mirroring, you may then want to disable using uca
# by setting in your user variables uca_enable: False
user_external_repos_list: []
# Set the package install state for distribution packages
# Options are 'present' and 'latest'
pip_install_package_state: "latest"
@ -143,15 +104,3 @@ pip_install_options: ""
# Always force getting the latest get-pip script
pip_get_pip_force: yes
# Set default mirror for CentOS repositories
# NOTE(mhayden): Ensure that the full path to the 'centos' directory is used.
#pip_install_centos_mirror_url: 'http://mirror.centos.org/centos'
## Set default mirror for openSUSE repositories
# NOTE(hwoarang): Ensure that the full path to the 'opensuse' directory is used.
# Additionally, set 'pip_install_opensuse_mirror_obs_url' to a mirror which also mirrors
# the OBS repositories. If you want to use the same mirror in both cases, then leave the
# 'pip_install_opensuse_mirror_obs_url' to its default value.
#pip_install_opensuse_mirror_url: 'http://widehat.opensuse.org'
pip_install_opensuse_mirror_obs_url: "{{ pip_install_opensuse_mirror_url | default('http://download.opensuse.org') }}"

View File

@ -13,17 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Remove known problem packages
package:
name: "{{ pip_install_remove_distro_packages }}"
state: absent
register: remove_packages
until: remove_packages|success
retries: 5
delay: 2
- include: "pre_install_{{ ansible_pkg_mgr }}.yml"
- name: Install distro packages
package:
name: "{{ pip_install_distro_packages }}"

View File

@ -1,71 +0,0 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Under Ubuntu, this will only add the key
- name: Install UCA repository key
apt:
name: "{{ pip_install_external_repo_key_package }}"
state: "{{ pip_install_external_repo_key_package_state | default('present') }}"
update_cache: yes
cache_valid_time: "{{ cache_timeout }}"
when:
- user_external_repo_key is not defined
retries: 5
delay: 2
tags:
- add-repo-keys
- name: Install UCA repository
apt_repository:
repo: "{{ uca_repo }}"
state: present
update_cache: yes
filename: "{{ uca_apt_source_list_filename | default(omit) }}"
register: uca_add_repo
until: uca_add_repo|success
retries: 5
delay: 2
when:
- uca_enable
tags:
- add-uca-repo
- name: Install external repo key manually (apt)
apt_key:
id: "{{ item.id | default(omit) }}"
keyserver: "{{ item.keyserver | default(omit) }}"
url: "{{ item.url | default(omit) }}"
state: "{{ item.state | default('present') }}"
register: add_keys
until: add_keys|success
retries: 5
delay: 2
with_items: "{{ user_external_repo_keys_list }}"
tags:
- add-repo-keys
- name: Install external repo manually (apt)
apt_repository:
repo: "{{ item.repo }}"
state: "{{ item.state | default('present') }}"
update_cache: yes
filename: "{{ item.filename | default(omit) }}"
register: use_external_repo_apt
until: use_external_repo_apt|success
retries: 5
delay: 2
with_items: "{{ user_external_repos_list }}"
tags:
- add-external-repo

View File

@ -1 +0,0 @@
pre_install_yum.yml

View File

@ -1,139 +0,0 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE(mhayden): GPG checking for local package installs is normally disabled
# by default in CentOS, but the openstack-ansible-security role enables GPG
# checking for local packages. The RDO repository package isn't signed, but the
# repos it installs have GPG checking enabled.
# Under CentOS, this will add the RDO repo and its key to the keyring
- name: Install EPEL and yum priorities plugin
package:
name: "{{ pip_epel_prep_distro_packages }}"
state: "{{ pip_install_package_state }}"
when:
- user_external_repo_key is not defined
tags:
- add-repo-keys
# Copy all factored-in GPG keys.
# KeyID 764429E6 from https://raw.githubusercontent.com/rdo-infra/centos-release-openstack/ocata-rdo/RPM-GPG-KEY-CentOS-SIG-Cloud
# KeyID 61E8806C from keyserver for rdo-qemu-ev
- name: Copy validated GPG keys
copy:
src: "gpg/{{ item | basename }}"
dest: /etc/pki/rpm-gpg/
mode: '0644'
with_fileglob:
- "gpg/*"
- name: Ensure GPG keys have the correct SELinux contexts applied
command: restorecon -Rv /etc/pki/rpm-gpg/
changed_when: false
# Handle gpg keys manually
- name: Install gpg keys
rpm_key:
key: "{{ key.keyfile | default(key.key) }}"
validate_certs: "{{ key.validate_certs | default(omit) }}"
state: "{{ key.state | default('present') }}"
with_items: "{{ pip_install_rdo_repos_keys }}"
loop_control:
loop_var: key
register: _add_yum_keys
until: _add_yum_keys | success
retries: 5
delay: 2
- name: Check for existing yum repositories
shell: "yum-config-manager | grep 'repo:'"
changed_when: False
register: existing_yum_repos
when:
- user_external_repo_key is not defined
tags:
- add-repo-keys
- name: Add yum repositories if they do not exist
yum_repository:
name: "{{ item.name }}"
description: "{{ item.description }}"
baseurl: "{{ item.baseurl }}"
file: "{{ item.file }}"
gpgcheck: "{{ item.gpgcheck }}"
enabled: "{{ item.enabled }}"
with_items:
- "{{ pip_install_rdo_repos }}"
when:
- item.name not in existing_yum_repos.stdout
- user_external_repo_key is not defined
tags:
- add-repo-keys
- name: Update yum repositories if they already exist
command: >
yum-config-manager
--enable {{ item.name }}
{% for key in item.keys() if key != 'file' %}
--setopt="{{ item.name }}.{{ key }}={{ item[key] }}"
{% endfor %}
changed_when: False
with_items:
- "{{ pip_install_rdo_repos }}"
when:
- item.name in existing_yum_repos.stdout
- user_external_repo_key is not defined
tags:
- add-repo-keys
- name: Enable and set repo priorities
command: >
yum-config-manager
{% for repo_priority in pip_install_repo_priorities %}
--enable {{ repo_priority['name'] }} \
--setopt="{{ repo_priority['name'] }}.priority={{ repo_priority['priority'] }}"
{% endfor %}
changed_when: False
tags:
- add-repo-keys
- name: Install external repo key manually
rpm_key:
key: "{{ item.key }}"
validate_certs: "{{ item.validate_certs | default(omit) }}"
state: "{{ item.state | default('present') }}"
register: add_keys
until: add_keys|success
retries: 5
delay: 2
with_items: "{{ user_external_repo_keys_list }}"
tags:
- add-repo-keys
- name: Install external repo manually
yum_repository:
name: "{{ item.name }}"
description: "{{ item.description | default(omit) }}"
baseurl: "{{ item.baseurl | default(omit) }}"
gpgkey: "{{ item.gpgkey | default(omit) }}"
gpgcheck: "{{ item.gpgcheck | default(omit) }}"
enabled: "{{ item.enabled | default('yes') }}"
register: use_external_repo_yum
until: use_external_repo_yum|success
retries: 5
delay: 2
with_items: "{{ user_external_repos_list }}"
tags:
- add-external-repo

View File

@ -1,37 +0,0 @@
---
# Copyright 2017, SUSE LINUX GmbH.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
- name: Ensure that openSUSE repositories are using the correct openSUSE mirror
zypper_repository:
auto_import_keys: yes
autorefresh: yes
name: "{{ item.name }}"
repo: "{{ item.url }}"
with_items:
- { name: "repo-oss", url: "{{ pip_install_opensuse_mirror_url }}/distribution/leap/{{ ansible_distribution_version }}/repo/oss" }
- { name: "repo-update", url: "{{ pip_install_opensuse_mirror_url }}/update/leap/{{ ansible_distribution_version }}/oss/" }
when: pip_install_opensuse_mirror_url is defined
- name: Add zypper cloud repository
zypper_repository:
auto_import_keys: yes
autorefresh: yes
name: "{{ item.name }}"
repo: "{{ item.uri }}"
runrefresh: yes
with_items: "{{ pip_install_external_repo }}"
tags:
- add-repo-keys

View File

@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
pip_install_external_repo_key_package: "https://repos.fedorapeople.org/repos/openstack/openstack-pike/rdo-release-pike-1.noarch.rpm"
pip_install_distro_build_packages:
- gcc
- libffi-devel
@ -22,48 +20,3 @@ pip_install_distro_build_packages:
- openssl-devel
- python-devel
- yum-plugin-priorities
pip_epel_prep_distro_packages:
- epel-release
- yum-plugin-priorities
- yum-utils
pip_install_remove_distro_packages:
- centos-openstack-release-*
- centos-release-ceph-jewel
- centos-release-qemu-ev
- centos-release-storage-common
pip_install_rdo_repos_keys:
- repo: openstack-pike
keyfile: /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud
- repo: rdo-qemu-ev
keyfile: /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization-RDO
pip_install_rdo_repos:
- file: rdo-qemu-ev
name: rdo-qemu-ev
description: "RDO CentOS-7 - QEMU EV"
baseurl: "{{ openstack_hosts_centos_mirror_url | default('http://mirror.centos.org') }}/centos/7/virt/x86_64/kvm-common/"
gpgcheck: yes
enabled: yes
- file: rdo-release
name: openstack-pike
description: "OpenStack Pike Repository"
baseurl: "{{ openstack_hosts_centos_mirror_url | default('http://mirror.centos.org') }}/centos/7/cloud/$basearch/openstack-pike/"
gpgcheck: yes
enabled: yes
pip_install_repo_priorities:
- name: base
priority: 50
- name: epel
priority: 99
- name: extras
priority: 50
- name: openstack-pike
priority: 50
- name: rdo-qemu-ev
priority: 50
- name: updates
priority: 50

View File

@ -13,10 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
pip_install_external_repo:
- name: "OBS:Cloud:OpenStack:Pike"
uri: "{{ pip_install_opensuse_mirror_obs_url }}/repositories/Cloud:/OpenStack:/Pike/openSUSE_Leap_{{ ansible_distribution_version }}"
pip_install_distro_build_packages:
- gcc
- libffi-devel

View File

@ -13,12 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Ubuntu Cloud Archive variables
uca_openstack_release: pike
uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}"
uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main"
pip_install_external_repo_key_package: "ubuntu-cloud-keyring"
pip_install_distro_build_packages:
- gcc
- python-dev