Files
openstack-ansible-os_keystone/tasks/keystone_install_yum.yml
Jesse Pretorius 56b547eb2d CentOS: Only install Federation IDP/SP Packages when necessary
In https://review.openstack.org/309425 adjustments were
made which resulted in keystone_idp and keystone_sp to
always be defined. Unfortunately the CentOS support for
os_keystone merged after that and reviews did not pick
up the necessary changes.

This patch corrects it so that the repo and packages are
only installed if necessary.

Additionally, the Federation SP callback template was
being unnecessarily copied over. It will now only copy
over when it will be used.

Change-Id: I466f1391893d33be7c83caba70ec93e44dd1d482
2016-11-15 13:02:45 +00:00

155 lines
4.2 KiB
YAML

---
# Copyright 2016, 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: Create keystone dir
file:
path: "{{ item.path }}"
state: directory
owner: "{{ item.owner|default(keystone_system_user_name) }}"
group: "{{ item.group|default(keystone_system_group_name) }}"
mode: "{{ item.mode|default('0755') }}"
with_items:
- { path: "/etc/pki/tls/certs", owner: "root", group: "root" }
- { path: "/etc/pki/tls/private", owner: "root", group: "root" }
- { path: "/var/lock/keystone", mode: "2755" }
- { path: "/var/log/httpd", mode: "2755" }
- name: Create system links
file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: "link"
with_items:
- { src: "/etc/pki/tls/certs", dest: "/etc/ssl/certs" }
- { src: "/etc/pki/tls/private", dest: "/etc/ssl/private" }
- { src: "/var/log/httpd", dest: "/var/log/apache2" }
- name: Install yum packages
yum:
pkg: "{{ item }}"
state: "{{ keystone_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ keystone_distro_packages }}"
- name: Install Apache yum packages
yum:
pkg: "{{ item }}"
state: "{{ keystone_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ keystone_apache_distro_packages }}"
when:
- keystone_apache_enabled | bool
- name: Install mod_wsgi yum packages
yum:
pkg: "{{ item }}"
state: "{{ keystone_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ keystone_mod_wsgi_distro_packages }}"
when:
- keystone_mod_wsgi_enabled | bool
- name: Install mod_proxy_uwsgi apt packages
yum:
pkg: "{{ item }}"
state: "{{ keystone_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ keystone_mod_proxy_uwsgi_distro_packages }}"
when:
- not keystone_mod_wsgi_enabled | bool
- name: Install Nginx yum packages
yum:
pkg: "{{ item }}"
state: "{{ keystone_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ keystone_nginx_distro_packages }}"
when:
- not keystone_apache_enabled | bool
- name: Install IdP yum packages
yum:
pkg: "{{ item }}"
state: "{{ keystone_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ keystone_idp_distro_packages }}"
when:
- keystone_idp != {}
#TODO(cloudnull) Remove this task once we move to Ansible 2.1
# where we can leverage the `yum_repository` module:
# https://docs.ansible.com/ansible/yum_repository_module.html
- name: Add shibboleth repo
copy:
content: |
[{{ item.name }}]
name={{ item.name }}
description={{ item.description }}
baseurl={{ item.baseurl }}
gpgkey={{ item.gpgkey }}
gpgcheck=1
enabled=1
dest: "/etc/yum.repos.d/{{ item.file }}.repo"
register: add_repos
until: add_repos|success
retries: 5
delay: 2
with_items:
- "{{ keystone_shibboleth_repo }}"
when:
- keystone_sp != {}
- name: Install SP yum packages
yum:
pkg: "{{ item }}"
state: "{{ keystone_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ keystone_sp_distro_packages }}"
when:
- keystone_sp != {}
- name: Install developer mode yum packages
yum:
pkg: "{{ item }}"
state: "{{ keystone_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ keystone_developer_mode_distro_packages }}"
when:
- keystone_developer_mode | bool