![kevin](/assets/img/avatar_default.png)
This change adds a reserved port for keystone based on the defined admin port in the variable `keystone_admin_port`. Please note this task is expected to fail as the current trusty kernel does not support this action (https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1279041) Change-Id: I18ef63747369c6722194b6412fea24fbb248ab1d Partial-Bug: #1426371 Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
115 lines
4.1 KiB
YAML
115 lines
4.1 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: Installation and setup of Keystone
|
|
hosts: keystone_all
|
|
max_fail_percentage: 20
|
|
user: root
|
|
pre_tasks:
|
|
- name: Use the lxc-openstack aa profile
|
|
lxc_container:
|
|
name: "{{ container_name }}"
|
|
container_config:
|
|
- "lxc.aa_profile=lxc-openstack"
|
|
delegate_to: "{{ physical_host }}"
|
|
when: not is_metal | bool
|
|
register: container_config
|
|
tags:
|
|
- lxc-aa-profile
|
|
- name: Wait for container ssh
|
|
wait_for:
|
|
port: "22"
|
|
delay: "{{ ssh_delay }}"
|
|
search_regex: "OpenSSH"
|
|
host: "{{ ansible_ssh_host }}"
|
|
delegate_to: "{{ physical_host }}"
|
|
when: container_config is defined and container_config | changed
|
|
register: ssh_wait_check
|
|
until: ssh_wait_check | success
|
|
retries: 3
|
|
tags:
|
|
- ssh-wait
|
|
- name: Sort the rabbitmq servers
|
|
dist_sort:
|
|
value_to_lookup: "{{ container_name }}"
|
|
ref_list: "{{ groups['keystone_all'] }}"
|
|
src_list: "{{ rabbitmq_servers }}"
|
|
register: servers
|
|
- name: Set rabbitmq servers
|
|
set_fact:
|
|
rabbitmq_servers: "{{ servers.sorted_list }}"
|
|
- name: Create log dir
|
|
file:
|
|
path: "{{ item.path }}"
|
|
state: directory
|
|
with_items:
|
|
- { path: "/openstack/log/{{ inventory_hostname }}-keystone" }
|
|
when: is_metal | bool
|
|
tags:
|
|
- keystone-logs
|
|
- keystone-log-dirs
|
|
- name: Create log aggregation links
|
|
file:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
state: "{{ item.state }}"
|
|
force: "yes"
|
|
with_items:
|
|
- { src: "/openstack/log/{{ inventory_hostname }}-keystone", dest: "/var/log/keystone", state: "link" }
|
|
when: is_metal | bool
|
|
tags:
|
|
- keystone-logs
|
|
# todo(cloudnull): this task is being run only if/when keystone is installed on a physical host.
|
|
# This is not being run within a container because it is an unsupported action due to this
|
|
# issue: (https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1279041)
|
|
# This issue was resolved however we'll need to eval it in the next LTS release.
|
|
# Related OSA Bug: https://launchpad.net/bugs/1426371
|
|
- name: Add keystone reserved port to physical host
|
|
sysctl:
|
|
name: "{{ item.key }}"
|
|
value: "{{ item.value }}"
|
|
sysctl_set: "{{ item.set|default('yes') }}"
|
|
state: "{{ item.state|default('present') }}"
|
|
reload: "{{ item.reload|default('yes') }}"
|
|
with_items:
|
|
- { key: "net.ipv4.ip_local_reserved_ports", value: "{{ keystone_admin_port }}"}
|
|
when: is_metal | bool
|
|
tags:
|
|
- keystone-reserved-port
|
|
roles:
|
|
- role: "os_keystone"
|
|
keystone_venv_tag: "{{ openstack_release }}"
|
|
keystone_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/keystone-{{ openstack_release }}.tgz"
|
|
keystone_galera_address: "{{ galera_address }}"
|
|
tags:
|
|
- "os-keystone"
|
|
- { role: "openstack_openrc", tags: [ "openstack-openrc" ] }
|
|
- role: "rsyslog_client"
|
|
rsyslog_client_log_rotate_file: keystone_log_rotate
|
|
rsyslog_client_log_dir: "/var/log/keystone"
|
|
rsyslog_client_config_name: "99-keystone-rsyslog-client.conf"
|
|
tags:
|
|
- "keystone-rsyslog-client"
|
|
- "rsyslog-client"
|
|
- role: "system_crontab_coordination"
|
|
tags:
|
|
- "system-crontab-coordination"
|
|
vars:
|
|
galera_address: "{{ internal_lb_vip_address }}"
|
|
keystone_admin_port: 35357
|
|
ansible_hostname: "{{ container_name }}"
|
|
is_metal: "{{ properties.is_metal|default(false) }}"
|
|
|