114 lines
3.2 KiB
YAML
114 lines
3.2 KiB
YAML
---
|
|
# Copyright 2014, 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.
|
|
|
|
- name: Download RDO repository RPM
|
|
get_url:
|
|
url: https://rdoproject.org/repos/openstack-ocata/rdo-release-ocata.rpm
|
|
dest: /tmp/rdo-release-ocata.rpm
|
|
tags:
|
|
- openstack-yum-packages
|
|
- openstack-packages
|
|
|
|
# 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.
|
|
- name: Install RDO repository and key
|
|
package:
|
|
name: /tmp/rdo-release-ocata.rpm
|
|
state: present
|
|
disable_gpg_check: yes
|
|
tags:
|
|
- openstack-yum-packages
|
|
- openstack-packages
|
|
|
|
- name: Ensure RDO repositories are using the correct CentOS mirror
|
|
command: |
|
|
yum-config-manager
|
|
--save
|
|
--setopt="{{ item.repo_name }}.baseurl={{ item.baseurl }}"
|
|
changed_when: false
|
|
with_items:
|
|
- repo_name: rdo-qemu-ev
|
|
baseurl: "{{ openstack_hosts_centos_mirror_url }}/7/virt/$basearch/kvm-common/"
|
|
- repo_name: openstack-ocata
|
|
baseurl: "{{ openstack_hosts_centos_mirror_url }}/7/cloud/$basearch/openstack-ocata/"
|
|
when:
|
|
- user_external_repo_key is not defined
|
|
- openstack_hosts_centos_mirror_url is defined
|
|
tags:
|
|
- add-repo-keys
|
|
|
|
|
|
- name: Install EPEL, and yum priorities plugin
|
|
package:
|
|
name: "{{ item }}"
|
|
state: "{{ openstack_hosts_package_state }}"
|
|
with_items:
|
|
- epel-release
|
|
- yum-plugin-priorities
|
|
- yum-utils
|
|
tags:
|
|
- openstack-yum-packages
|
|
- openstack-packages
|
|
|
|
- name: Enable and set repo priorities
|
|
command: |
|
|
yum-config-manager
|
|
--enable {{ item.name }}
|
|
--setopt="{{ item.name }}.priority={{ item.priority }}"
|
|
changed_when: false
|
|
with_items:
|
|
- name: base
|
|
priority: 50
|
|
- name: epel
|
|
priority: 99
|
|
- name: extras
|
|
priority: 50
|
|
- name: openstack-ocata
|
|
priority: 50
|
|
- name: rdo-qemu-ev
|
|
priority: 50
|
|
- name: updates
|
|
priority: 50
|
|
tags:
|
|
- openstack-yum-packages
|
|
- openstack-packages
|
|
|
|
- name: Remove conflicting distro packages
|
|
package:
|
|
name: "{{ openstack_host_distro_packages_remove | default([]) }}"
|
|
state: absent
|
|
|
|
- name: Install distro packages
|
|
package:
|
|
pkg: "{{ openstack_host_distro_packages }}"
|
|
state: "{{ openstack_hosts_package_state }}"
|
|
register: install_packages
|
|
until: install_packages | success
|
|
retries: 5
|
|
delay: 2
|
|
tags:
|
|
- openstack-yum-packages
|
|
- openstack-packages
|
|
|
|
- name: Disable requiretty for root sudo on centos
|
|
template:
|
|
dest: /etc/sudoers.d/openstack-ansible
|
|
owner: root
|
|
group: root
|
|
mode: "0440"
|
|
src: sudoers.j2
|