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>
This commit is contained in:
parent
6a0fc2376d
commit
35ed804e3a
@ -73,6 +73,10 @@
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-os_horizon
|
||||
scm: git
|
||||
version: master
|
||||
- name: os_ironic
|
||||
src: https://github.com/openstack/openstack-ansible-ironic
|
||||
scm: git
|
||||
version: master
|
||||
- name: os_neutron
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-os_neutron
|
||||
scm: git
|
||||
|
4
etc/openstack_deploy/conf.d/ironic.yml.aio
Normal file
4
etc/openstack_deploy/conf.d/ironic.yml.aio
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
ironic-infra_hosts:
|
||||
aio1:
|
||||
ip: 172.29.236.100
|
67
etc/openstack_deploy/env.d/ironic.yml
Normal file
67
etc/openstack_deploy/env.d/ironic.yml
Normal file
@ -0,0 +1,67 @@
|
||||
---
|
||||
# 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.
|
||||
|
||||
component_skel:
|
||||
ironic_api:
|
||||
belongs_to:
|
||||
- ironic_all
|
||||
ironic_conductor:
|
||||
belongs_to:
|
||||
- ironic_all
|
||||
ironic_server:
|
||||
belongs_to:
|
||||
- ironic_servers
|
||||
|
||||
container_skel:
|
||||
ironic_api_container:
|
||||
belongs_to:
|
||||
- ironic-infra_containers
|
||||
contains:
|
||||
- ironic_api
|
||||
properties:
|
||||
service_name: ironic
|
||||
container_release: trusty
|
||||
ironic_conductor_container:
|
||||
belongs_to:
|
||||
- ironic-infra_containers
|
||||
contains:
|
||||
- ironic_conductor
|
||||
properties:
|
||||
service_name: ironic
|
||||
container_release: trusty
|
||||
ironic_server_container:
|
||||
belongs_to:
|
||||
- ironic-server_containers
|
||||
contains:
|
||||
- ironic_server
|
||||
properties:
|
||||
is_metal: true
|
||||
service_name: ironic
|
||||
container_release: trusty
|
||||
|
||||
|
||||
physical_skel:
|
||||
ironic-infra_containers:
|
||||
belongs_to:
|
||||
- all_containers
|
||||
ironic-infra_hosts:
|
||||
belongs_to:
|
||||
- hosts
|
||||
ironic-server_containers:
|
||||
belongs_to:
|
||||
- all_containers
|
||||
ironic-server_hosts:
|
||||
belongs_to:
|
||||
- hosts
|
@ -71,6 +71,11 @@ heat_cfn_service_password:
|
||||
heat_profiler_hmac_key:
|
||||
heat_rabbitmq_password:
|
||||
|
||||
## Ironic options
|
||||
ironic_rabbitmq_password:
|
||||
ironic_galera_password:
|
||||
ironic_service_password:
|
||||
|
||||
## Horizon Options
|
||||
horizon_container_mysql_password:
|
||||
horizon_secret_key:
|
||||
|
@ -105,3 +105,9 @@ nova_git_dest: "/opt/nova_{{ nova_git_install_branch | replace('/', '_') }}"
|
||||
swift_git_repo: https://git.openstack.org/openstack/swift
|
||||
swift_git_install_branch: ee6af69af429e1a278581531e509be92774f668d # HEAD of "master" as of 03.04.2016
|
||||
swift_git_dest: "/opt/swift_{{ swift_git_install_branch | replace('/', '_') }}"
|
||||
|
||||
|
||||
## Ironic service
|
||||
ironic_git_repo: https://git.openstack.org/openstack/ironic
|
||||
ironic_git_install_branch: 8d105f60790ce108f65de90fc68e6e8651a87b4d # HEAD of "stable/mitaka" as of 23.03.2016
|
||||
ironic_git_dest: "/opt/ironic_{{ ironic_git_install_branch | replace('/', '_') }}"
|
||||
|
@ -54,6 +54,7 @@ rabbitmq_servers: "{% for host in groups['rabbitmq_all'] %}{{ hostvars[host]['an
|
||||
rabbitmq_use_ssl: true
|
||||
|
||||
## Galera
|
||||
galera_root_user: "root"
|
||||
galera_wsrep_cluster_address: "{% for host in groups['galera_all'] %}{{ hostvars[host]['ansible_ssh_host'] }}{% if not loop.last %},{% endif %}{% endfor %}"
|
||||
galera_wsrep_address: "{{ ansible_ssh_host }}"
|
||||
|
||||
@ -269,6 +270,20 @@ swift_rabbitmq_userid: swift
|
||||
swift_rabbitmq_vhost: /swift
|
||||
|
||||
|
||||
## Ironic
|
||||
ironic_rabbitmq_vhost: /ironic
|
||||
ironic_rabbitmq_userid: ironic
|
||||
ironic_galera_database: ironic
|
||||
ironic_galera_user: ironic
|
||||
ironic_service_name: ironic
|
||||
ironic_service_project_name: service
|
||||
ironic_service_port: 6385
|
||||
ironic_service_proto: http
|
||||
ironic_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(ironic_service_proto) }}"
|
||||
ironic_service_adminuri: "{{ ironic_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ ironic_service_port }}"
|
||||
ironic_service_adminurl: "{{ ironic_service_adminuri }}/v1"
|
||||
|
||||
|
||||
## OpenStack Openrc
|
||||
openrc_os_auth_url: "{{ keystone_service_internalurl }}"
|
||||
openrc_os_password: "{{ keystone_auth_admin_password }}"
|
||||
|
126
playbooks/os-ironic-install.yml
Normal file
126
playbooks/os-ironic-install.yml
Normal file
@ -0,0 +1,126 @@
|
||||
---
|
||||
# Copyright 2016, Rackspace, 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 Ironic
|
||||
hosts: ironic_all
|
||||
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: Create DB for Ironic
|
||||
mysql_db:
|
||||
login_user: "{{ galera_root_user }}"
|
||||
login_password: "{{ galera_root_password }}"
|
||||
login_host: "{{ ironic_galera_address }}"
|
||||
name: "{{ ironic_galera_database }}"
|
||||
state: "present"
|
||||
delegate_to: "{{ groups['galera_all'][0] }}"
|
||||
run_once: true
|
||||
tags:
|
||||
- ironic-db-setup
|
||||
- name: Grant access to the DB for Ironic
|
||||
mysql_user:
|
||||
login_user: "{{ galera_root_user }}"
|
||||
login_password: "{{ galera_root_password }}"
|
||||
login_host: "{{ ironic_galera_address }}"
|
||||
name: "{{ ironic_galera_user }}"
|
||||
password: "{{ ironic_galera_password }}"
|
||||
host: "{{ item }}"
|
||||
state: "present"
|
||||
priv: "{{ ironic_galera_database }}.*:ALL"
|
||||
with_items:
|
||||
- "localhost"
|
||||
- "%"
|
||||
delegate_to: "{{ groups['galera_all'][0] }}"
|
||||
run_once: true
|
||||
tags:
|
||||
- ironic-db-setup
|
||||
- name: Ensure Rabbitmq vhost for Ironic
|
||||
rabbitmq_vhost:
|
||||
name: "{{ ironic_rabbitmq_vhost }}"
|
||||
state: "present"
|
||||
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
|
||||
run_once: true
|
||||
tags:
|
||||
- ironic-rabbitmq
|
||||
- ironic-rabbitmq-vhost
|
||||
- name: Ensure rabbitmq user for Ironic
|
||||
rabbitmq_user:
|
||||
user: "{{ ironic_rabbitmq_userid }}"
|
||||
password: "{{ ironic_rabbitmq_password }}"
|
||||
vhost: "{{ ironic_rabbitmq_vhost }}"
|
||||
configure_priv: ".*"
|
||||
read_priv: ".*"
|
||||
write_priv: ".*"
|
||||
state: "present"
|
||||
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
|
||||
run_once: true
|
||||
tags:
|
||||
- ironic-rabbitmq
|
||||
- ironic-rabbitmq-user
|
||||
- name: Sort the rabbitmq servers
|
||||
dist_sort:
|
||||
value_to_lookup: "{{ container_name }}"
|
||||
ref_list: "{{ groups['ironic_all'] }}"
|
||||
src_list: "{{ rabbitmq_servers }}"
|
||||
register: servers
|
||||
- name: Set rabbitmq servers
|
||||
set_fact:
|
||||
rabbitmq_servers: "{{ servers.sorted_list }}"
|
||||
roles:
|
||||
- role: "os_ironic"
|
||||
ironic_venv_tag: "{{ openstack_release }}"
|
||||
ironic_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/ironic-{{ openstack_release }}.tgz"
|
||||
tags:
|
||||
- "os-ironic"
|
||||
- role: "openstack_openrc"
|
||||
tags:
|
||||
- "openstack-openrc"
|
||||
- role: "rsyslog_client"
|
||||
rsyslog_client_log_rotate_file: ironic_log_rotate
|
||||
rsyslog_client_log_dir: "/var/log/ironic"
|
||||
rsyslog_client_config_name: "99-ironic-rsyslog-client.conf"
|
||||
tags:
|
||||
- "ironic-rsyslog-client"
|
||||
- "rsyslog-client"
|
||||
- role: "system_crontab_coordination"
|
||||
tags:
|
||||
- "system-crontab-coordination"
|
||||
vars:
|
||||
ansible_hostname: "{{ container_name }}"
|
||||
ansible_ssh_host: "{{ container_address }}"
|
||||
ironic_galera_address: "{{ internal_lb_vip_address }}"
|
||||
is_metal: "{{ properties.is_metal|default(false) }}"
|
@ -23,3 +23,4 @@
|
||||
- include: os-ceilometer-install.yml
|
||||
- include: os-aodh-install.yml
|
||||
- include: os-swift-install.yml
|
||||
- include: os-ironic-install.yml
|
||||
|
@ -121,6 +121,7 @@
|
||||
- python-keystoneclient
|
||||
- python-neutronclient
|
||||
- python-novaclient
|
||||
- python-ironicclient
|
||||
- python-swiftclient
|
||||
- python-memcached
|
||||
- pycrypto
|
||||
|
@ -185,3 +185,8 @@ haproxy_service_configs:
|
||||
haproxy_backend_nodes: "{{ groups['aodh_api'] | default([]) }}"
|
||||
haproxy_port: 8042
|
||||
haproxy_balance_type: http
|
||||
- service:
|
||||
haproxy_service_name: ironic_api
|
||||
haproxy_backend_nodes: "{{ groups['ironic_api'] | default([]) }}"
|
||||
haproxy_port: 6385
|
||||
haproxy_balance_type: http
|
||||
|
@ -26,6 +26,7 @@ DEPLOY_OPENSTACK=${DEPLOY_OPENSTACK:-"yes"}
|
||||
DEPLOY_SWIFT=${DEPLOY_SWIFT:-"yes"}
|
||||
DEPLOY_CEILOMETER=${DEPLOY_CEILOMETER:-"yes"}
|
||||
DEPLOY_TEMPEST=${DEPLOY_TEMPEST:-"yes"}
|
||||
DEPLOY_IRONIC=${DEPLOY_IRONIC:-"no"}
|
||||
COMMAND_LOGS=${COMMAND_LOGS:-"/openstack/log/ansible_cmd_logs/"}
|
||||
ADD_NEUTRON_AGENT_CHECKSUM_RULE=${ADD_NEUTRON_AGENT_CHECKSUM_RULE:-"yes"}
|
||||
|
||||
@ -133,6 +134,11 @@ pushd "playbooks"
|
||||
install_bits os-swift-install.yml
|
||||
fi
|
||||
|
||||
if [ "${DEPLOY_IRONIC}" == "yes" ]; then
|
||||
# install all of the ironic Bits
|
||||
install_bits os-ironic-install.yml
|
||||
fi
|
||||
|
||||
if [ "${DEPLOY_TEMPEST}" == "yes" ]; then
|
||||
# Deploy tempest
|
||||
install_bits os-tempest-install.yml
|
||||
|
@ -50,6 +50,8 @@
|
||||
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
|
||||
@ -90,6 +92,8 @@
|
||||
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
|
||||
|
||||
|
@ -111,6 +111,18 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase):
|
||||
'identity_hosts',
|
||||
'infra_containers',
|
||||
'infra_hosts',
|
||||
'ironic-server_hosts',
|
||||
'ironic_conductor_container',
|
||||
'ironic_api_container',
|
||||
'ironic_conductor',
|
||||
'ironic-infra_containers',
|
||||
'ironic-infra_hosts',
|
||||
'ironic_servers',
|
||||
'ironic-server_containers',
|
||||
'ironic_all',
|
||||
'ironic_server',
|
||||
'ironic_server_container',
|
||||
'ironic_api',
|
||||
'keystone',
|
||||
'keystone_all',
|
||||
'keystone_container',
|
||||
|
Loading…
Reference in New Issue
Block a user