Michael Davies 35ed804e3a Add installation support for os_ironic
This patch adds the initial support for the ironic role in
openstack-ansible, but leaves ironic unconfigured and not
installed by default.

Configuration, including Nova configuration, will be addressed in
subsequent patches.

Change-Id: Id9f01deb5c46ee2186b9c41c7f88205560b5f437
Depends-On: Ide66c7ee59192ac441ac2919028eca0ad665ceea
Depends-On: I590f5ade90b3e37af7f1b8ee333000d4f993f8c5
Partially-implements: blueprint role-ironic
Signed-off-by: Michael Davies <michael@the-davies.net>
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-04-14 10:12:19 +00:00

199 lines
6.5 KiB
YAML

---
# Copyright 2015, 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 the required deployment directories
file:
path: "{{ item }}"
state: directory
with_items:
- "/etc/openstack_deploy/"
- "/etc/openstack_deploy/conf.d"
- "/etc/openstack_deploy/env.d"
tags:
- create-directories
- name: Deploy environment (env.d) configuration
config_template:
src: "../etc/openstack_deploy/env.d/{{ item.name }}"
dest: "/etc/openstack_deploy/env.d/{{ item.name }}"
config_overrides: "{{ item.override }}"
config_type: "yaml"
with_items:
- name: aodh.yml
override: "{{ aodh_env_overrides | default({}) }}"
- name: ceilometer.yml
override: "{{ ceilometer_env_overrides | default({}) }}"
- name: cinder.yml
override: "{{ cinder_env_overrides | default({}) }}"
- name: galera.yml
override: "{{ galera_env_overrides | default({}) }}"
- name: glance.yml
override: "{{ glance_env_overrides | default({}) }}"
- name: haproxy.yml
override: "{{ haproxy_env_overrides | default({}) }}"
- name: heat.yml
override: "{{ heat_env_overrides | default({}) }}"
- name: horizon.yml
override: "{{ horizon_env_overrides | default({}) }}"
- name: infra.yml
override: "{{ infra_env_overrides | default({}) }}"
- name: ironic.yml
override: "{{ ironic_env_overrides | default({}) }}"
- name: keystone.yml
override: "{{ keystone_env_overrides | default({}) }}"
- name: memcache.yml
override: "{{ memcache_env_overrides | default({}) }}"
- name: neutron.yml
override: "{{ neutron_env_overrides | default({}) }}"
- name: nova.yml
override: "{{ nova_env_overrides | default({}) }}"
- name: os-infra.yml
override: "{{ os_infra_env_overrides | default({}) }}"
- name: pkg_repo.yml
override: "{{ pkg_repo_env_overrides | default({}) }}"
- name: rabbitmq.yml
override: "{{ rabbitmq_env_overrides | default({}) }}"
- name: rsyslog.yml
override: "{{ rsyslog_env_overrides | default({}) }}"
- name: shared-infra.yml
override: "{{ shared_infra_env_overrides | default({}) }}"
- name: swift-remote.yml
override: "{{ swift_remote_env_overrides | default({}) }}"
- name: swift.yml
override: "{{ swift_env_overrides | default({}) }}"
- name: utility.yml
override: "{{ utility_env_overrides | default({}) }}"
tags:
- deploy-envd
- name: Deploy user conf.d configuration
config_template:
src: "../etc/openstack_deploy/conf.d/{{ item.name }}"
dest: "/etc/openstack_deploy/conf.d/{{ item.name | regex_replace('.aio$', '') }}"
config_overrides: "{{ item.override }}"
config_type: "yaml"
with_items:
- name: aodh.yml.aio
override: "{{ aodh_conf_overrides | default({}) }}"
- name: ceilometer.yml.aio
override: "{{ ceilometer_conf_overrides | default({}) }}"
- name: swift.yml.aio
override: "{{ swift_conf_overrides | default({}) }}"
- name: ironic.yml.aio
override: "{{ ironic_conf_overrides | default({}) }}"
tags:
- deploy-confd
- name: Deploy openstack_user_config
config_template:
src: "../etc/openstack_deploy/openstack_user_config.yml.aio"
dest: "/etc/openstack_deploy/openstack_user_config.yml"
config_overrides: "{{ openstack_user_config_overrides | default({}) }}"
config_type: "yaml"
tags:
- deploy-openstack-user-config
- name: Deploy user_secrets file
config_template:
src: "../etc/openstack_deploy/user_secrets.yml"
dest: "/etc/openstack_deploy/user_secrets.yml"
config_overrides: "{{ user_secrets_overrides | default({}) }}"
config_type: "yaml"
tags:
- deploy-user-secrets
- name: Generate any missing values in user_secrets
shell: ../scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
tags:
- generate_secrets
- name: Get the DNS servers in use on the host
shell: grep nameserver /etc/resolv.conf
register: nameservers
when:
- lxc_cache_resolvers is not defined
tags:
- get-nameservers
- name: Set lxc_cache_resolvers fact
set_fact:
lxc_cache_resolvers: "[\"{{ nameservers.stdout_lines | join('\",\"') }}\"]"
when:
- nameservers is defined
tags:
- set-fact-lxc_cache_resolvers
- name: Set the user_variables
config_template:
src: user_variables.aio.yml.j2
dest: /etc/openstack_deploy/user_variables.yml
config_overrides: "{{ user_variables_overrides | default({}) }}"
config_type: yaml
- name: Determine if the host has a global pip config file
stat:
path: /etc/pip.conf
register: pip_conf_file
- name: Add user_conf_files to contain the list of files to copy into containers
file:
path: /etc/openstack_deploy/user_conf_files.yml
state: touch
when:
- apt_conf_files is defined or pip_conf_file.stat.exists
tags:
- container-conf-files
- name: Ensure that the first line in user_conf_files is correct
lineinfile:
dest: /etc/openstack_deploy/user_conf_files.yml
line: "---"
insertbefore: BOF
when:
- apt_conf_files is defined or pip_conf_file.stat.exists
tags:
- container-conf-files
- name: Ensure that the second line in user_conf_files is correct
lineinfile:
dest: /etc/openstack_deploy/user_conf_files.yml
line: "lxc_container_cache_files:"
insertafter: "^---"
when:
- apt_conf_files is defined or pip_conf_file.stat.exists
tags:
- container-conf-files
- name: Add the dict to copy the global pip config file into user_conf_files
lineinfile:
dest: /etc/openstack_deploy/user_conf_files.yml
line: " - { src: '/etc/pip.conf', dest: '/etc/pip.conf' }"
when:
- pip_conf_file.stat.exists
tags:
- container-conf-files
- name: Add the list of dicts for the apt config files into user_conf_files
lineinfile:
dest: /etc/openstack_deploy/user_conf_files.yml
line: " - { src: '/etc/apt/apt.conf.d/{{ item }}', dest: '/etc/apt/apt.conf.d/{{ item }}' }"
with_items: apt_conf_files.stdout_lines
when:
- apt_conf_files is defined
- apt_conf_files.stdout_lines | length > 0
tags:
- container-conf-files