From 6710eccd8d3c3537885eebbb5cd8bbdfa5f62e69 Mon Sep 17 00:00:00 2001 From: Uros Orozel Date: Fri, 23 Feb 2018 04:31:56 +0000 Subject: [PATCH] Added openstack ironic inspector env files and playbook --- etc/openstack_deploy/user_secrets.yml | 5 ++ group_vars/all/haproxy.yml | 10 ++++ group_vars/all/ironic_inspector.yml | 23 ++++++++ group_vars/ironic_inspector_all.yml | 25 +++++++++ .../repo_packages/openstack_services.yml | 5 ++ .../inventory/env.d/ironic-inspector.yml | 53 ++++++++++++++++++ playbooks/os-ironic-inspector-install.yml | 55 +++++++++++++++++++ 7 files changed, 176 insertions(+) create mode 100644 group_vars/all/ironic_inspector.yml create mode 100644 group_vars/ironic_inspector_all.yml create mode 100644 playbooks/inventory/env.d/ironic-inspector.yml create mode 100644 playbooks/os-ironic-inspector-install.yml diff --git a/etc/openstack_deploy/user_secrets.yml b/etc/openstack_deploy/user_secrets.yml index 55293f1dfa..dc8b5b082f 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -81,6 +81,11 @@ ironic_container_mysql_password: ironic_service_password: ironic_swift_temp_url_secret_key: +## Ironic inspector options +ironic_inspector_swift_password: +ironic_inspector_container_mysql_password: +ironic_inspector_service_password: + ## Horizon Options horizon_container_mysql_password: horizon_secret_key: diff --git a/group_vars/all/haproxy.yml b/group_vars/all/haproxy.yml index 8b01230cd8..fe740d9a3b 100644 --- a/group_vars/all/haproxy.yml +++ b/group_vars/all/haproxy.yml @@ -221,6 +221,16 @@ haproxy_default_services: haproxy_balance_type: http haproxy_backend_options: - "httpchk GET /" + - service: + haproxy_service_name: ironic_inspector + haproxy_backend_nodes: "{{ groups['ironic_inspector'] | default([]) }}" + haproxy_ssl: "{{ haproxy_ssl }}" + haproxy_port: 5050 + haproxy_balance_type: http + haproxy_backend_options: + - "httpchk GET /" + haproxy_backend_arguments: + - "http-check expect rstring .*" - service: haproxy_service_name: rabbitmq_mgmt haproxy_backend_nodes: "{{ groups['rabbitmq'] | default([]) }}" diff --git a/group_vars/all/ironic_inspector.yml b/group_vars/all/ironic_inspector.yml new file mode 100644 index 0000000000..197b7f00a9 --- /dev/null +++ b/group_vars/all/ironic_inspector.yml @@ -0,0 +1,23 @@ +--- +# Copyright 2017, 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. + +ironic_inspector_keystone_auth_plugin: password +ironic_inspector_service_name: ironic-inspector +ironic_inspector_service_user_name: ironic-inspector +ironic_inspector_service_proto: http +ironic_inspector_service_port: 5050 +ironic_inspector_service_project_name: service +ironic_inspector_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(ironic_inspector_service_proto) }}" +ironic_inspector_service_adminurl: "{{ ironic_inspector_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ ironic_inspector_service_port }}" diff --git a/group_vars/ironic_inspector_all.yml b/group_vars/ironic_inspector_all.yml new file mode 100644 index 0000000000..e8eed02ce2 --- /dev/null +++ b/group_vars/ironic_inspector_all.yml @@ -0,0 +1,25 @@ +--- +# 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. + +ironic_inspector_galera_database: ironic_inspector +ironic_inspector_galera_user: ironic-inspector +ironic_inspector_service_adminurl: "{{ ironic_inspector_service_adminuri }}/v1" + +# Ensure that the package state matches the global setting +ironic_inspector_package_state: "{{ package_state }}" + +# venv fetch configuration +ironic_inspector_venv_tag: "{{ venv_tag }}" +ironic_inspector_venv_download_url: "{{ venv_base_download_url }}/ironic_inspector-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz" diff --git a/playbooks/defaults/repo_packages/openstack_services.yml b/playbooks/defaults/repo_packages/openstack_services.yml index ef56675daf..d9c25b789f 100644 --- a/playbooks/defaults/repo_packages/openstack_services.yml +++ b/playbooks/defaults/repo_packages/openstack_services.yml @@ -186,6 +186,11 @@ ironic_git_repo: https://git.openstack.org/openstack/ironic ironic_git_install_branch: a26082ac195cb3d4a9f5f6f7638d1357c58d3e03 # HEAD of "stable/pike" as of 19.01.2018 ironic_git_project_group: ironic_all +## Ironic inspector +ironic_inspector_git_repo: https://git.openstack.org/openstack/ironic-inspector +ironic_inspector_git_install_branch: 3b9e4c065655550ff6c5076d1f7c9129bdf413ee #35828784d5124dfc66842a790282f9f7d03251fe +ironic_inspector_git_project_group: ironic_inspector_all + ## Magnum service magnum_git_repo: https://git.openstack.org/openstack/magnum magnum_git_install_branch: 1594d552c4027e5ede501ba83e06f89a0c8e3849 # HEAD of "stable/pike" as of 19.01.2018 diff --git a/playbooks/inventory/env.d/ironic-inspector.yml b/playbooks/inventory/env.d/ironic-inspector.yml new file mode 100644 index 0000000000..dc16d2c15e --- /dev/null +++ b/playbooks/inventory/env.d/ironic-inspector.yml @@ -0,0 +1,53 @@ +--- +# 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_inspector: + belongs_to: + - ironic_inspector_all + ironic_inspector_server: + belongs_to: + - ironic_inspector_servers + + +container_skel: + ironic_inspector_container: + belongs_to: + - ironic-inspector-infra_containers + contains: + - ironic_inspector + ironic_inspector_server_container: + belongs_to: + - ironic-inspector-server_containers + contains: + - ironic_inspector_server + properties: + is_metal: true + + +physical_skel: + ironic-inspector-infra_containers: + belongs_to: + - all_containers + ironic-inspector-infra_hosts: + belongs_to: + - hosts + ironic-inspector-server_containers: + belongs_to: + - all_containers + ironic-inspector-server_hosts: + belongs_to: + - hosts diff --git a/playbooks/os-ironic-inspector-install.yml b/playbooks/os-ironic-inspector-install.yml new file mode 100644 index 0000000000..473def58a5 --- /dev/null +++ b/playbooks/os-ironic-inspector-install.yml @@ -0,0 +1,55 @@ +--- +# 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_inspector_all + gather_facts: "{{ osa_gather_facts | default(True) }}" + user: root + pre_tasks: + - include: common-tasks/os-lxc-container-setup.yml + static: no + when: + - inventory_hostname == groups['ironic_inspector_all'][0] + - include: common-tasks/mysql-db-user.yml + static: no + vars: + user_name: "{{ ironic_inspector_galera_user }}" + password: "{{ ironic_inspector_container_mysql_password }}" + login_host: "{{ ironic_inspector_galera_address }}" + db_name: "{{ ironic_inspector_galera_database }}" + when: inventory_hostname == groups['ironic_inspector_all'][0] + - include: common-tasks/package-cache-proxy.yml + roles: + - role: "os_ironic_inspector" + - role: "openstack_openrc" + tags: + - openrc + - role: "rsyslog_client" + rsyslog_client_log_rotate_file: ironic_inspector_log_rotate + rsyslog_client_log_dir: "/var/log/ironic-inspector" + rsyslog_client_config_name: "99-ironic-inspector-rsyslog-client.conf" + tags: + - rsyslog + - role: "system_crontab_coordination" + tags: + - crontab + vars: + is_metal: "{{ properties.is_metal|default(false) }}" + ironic_inspector_galera_user: ironic_inspector + ironic_inspector_galera_database: ironic_inspector + ironic_inspector_galera_address: "{{ galera_address }}" + environment: "{{ deployment_environment_variables | default({}) }}" + tags: + - ironic_inspector