Skip to content

Commit

Permalink
Gather additional required facts to min
Browse files Browse the repository at this point in the history
With minimal facts gathering we will experience failures while trying to
evaluate amount of threads for apis or mounts for hardening. So to avoid
gathering full hardware subset, we add common-task which will gather
only specific subset that can be additionally filtered.

Gathering processor or mounts subsent simply does not work with ansible
and result in full hardware subset as well.

Change-Id: Ia5802b4ec0b18271b8c5fbcc5574b484c5233a01
  • Loading branch information
Dmitriy Rabotyagov authored and Dmitriy Rabotyagov committed Jun 1, 2021
1 parent 82e3d01 commit f89d87c
Show file tree
Hide file tree
Showing 32 changed files with 219 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inventory/group_vars/all/all.yml
Expand Up @@ -145,3 +145,6 @@ _global_pins_file_path: "{{ openstack_clone_root }}/global-requirement-pins.txt"

venv_build_global_constraints: >-
{{ lookup('file', _global_pins_file_path).splitlines() | reject('match','^#.*$') | reject('equalto', '') | list }}
deployment_extra_facts_subset: hardware
deployment_extra_facts_filter: ansible_processor_*
42 changes: 42 additions & 0 deletions playbooks/ceph-install.yml
Expand Up @@ -27,6 +27,32 @@
- "defaults/{{ install_method }}_install.yml"
pre_tasks:

- name: Gather additional facts for monitor_address_block
include_tasks: "common-tasks/gather-hardware-facts.yml"
vars:
deployment_extra_facts_filter: "ansible_all_ipv[4,6]_addresses"
deployment_extra_facts_subset: "!all,network"
when: monitor_address_block is defined
tags:
- always

- name: Gather additional facts for monitor_interface
include_tasks: "common-tasks/gather-hardware-facts.yml"
vars:
deployment_extra_facts_filter: "{{ 'ansible_' ~ monitor_interface | replace('-','_') }}"
deployment_extra_facts_subset: "!all,network"
when: monitor_interface is defined
tags:
- always

- name: Gather memory facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
vars:
deployment_extra_facts_filter: "ansible_memtotal*"
deployment_extra_facts_subset: "!all,hardware"
tags:
- always

- import_tasks: common-tasks/ceph-server.yml

- name: Create systemd service directory
Expand Down Expand Up @@ -102,6 +128,14 @@
- "defaults/{{ install_method }}_install.yml"
pre_tasks:

- name: Gather memory facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
vars:
deployment_extra_facts_filter: "ansible_memtotal*"
deployment_extra_facts_subset: "!all,hardware"
tags:
- always

- import_tasks: common-tasks/ceph-server.yml

roles:
Expand Down Expand Up @@ -151,6 +185,14 @@
user: root
vars_files:
- "defaults/{{ install_method }}_install.yml"
pre_tasks:
- name: Gather memory facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
vars:
deployment_extra_facts_filter: "ansible_memtotal*"
deployment_extra_facts_subset: "!all,hardware"
tags:
- always
roles:
- role: ceph-defaults
tags:
Expand Down
19 changes: 19 additions & 0 deletions playbooks/common-tasks/gather-hardware-facts.yml
@@ -0,0 +1,19 @@
---
# Copyright 2021, City Network International AB
#
# 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: Gather additional facts
setup:
gather_subset: "{{ deployment_extra_facts_subset }}"
filter: "{{ deployment_extra_facts_filter }}"
5 changes: 5 additions & 0 deletions playbooks/os-adjutant-install.yml
Expand Up @@ -31,6 +31,11 @@
tags:
- adjutant
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

# In order to ensure that any container, software or
# config file changes which causes a container/service
# restart do not cause an unexpected outage, we drain
Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-aodh-install.yml
Expand Up @@ -30,6 +30,11 @@
tags:
- aodh
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-barbican-install.yml
Expand Up @@ -30,6 +30,11 @@
tags:
- barbican
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-blazar-install.yml
Expand Up @@ -30,6 +30,11 @@
tags:
- blazar
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-ceilometer-install.yml
Expand Up @@ -27,6 +27,11 @@
- "defaults/repo_packages/openstack_services.yml"
- "defaults/{{ install_method }}_install.yml"
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-cloudkitty-install.yml
Expand Up @@ -32,6 +32,11 @@
tags:
- cloudkitty
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

# In order to ensure that any container, software or
# config file changes which causes a container/service
# restart do not cause an unexpected outage, we drain
Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-designate-install.yml
Expand Up @@ -33,6 +33,11 @@
tags:
- designate
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-glance-install.yml
Expand Up @@ -31,6 +31,11 @@
tags:
- glance
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

# In order to ensure that any container, software or
# config file changes which causes a container/service
# restart do not cause an unexpected outage, we drain
Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-gnocchi-install.yml
Expand Up @@ -31,6 +31,11 @@
tags:
- gnocchi
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
vars:
list_of_bind_mounts: "{{ gnocchi_container_bind_mounts }}"
Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-heat-install.yml
Expand Up @@ -30,6 +30,11 @@
- defaults/repo_packages/openstack_services.yml
- "defaults/{{ install_method }}_install.yml"
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-horizon-install.yml
Expand Up @@ -30,6 +30,11 @@
tags:
- horizon
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal
- include_tasks: common-tasks/unbound-clients.yml
Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-ironic-install.yml
Expand Up @@ -30,6 +30,11 @@
tags:
- ironic
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
4 changes: 4 additions & 0 deletions playbooks/os-keystone-install.yml
Expand Up @@ -46,6 +46,10 @@
tags:
- keystone
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

# In order to ensure that any container, software or
# config file changes which causes a container/service
Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-magnum-install.yml
Expand Up @@ -33,6 +33,11 @@
tags:
- magnum
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-manila-install.yml
Expand Up @@ -33,6 +33,11 @@
tags:
- manila
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

# In order to ensure that any container, software or
# config file changes which causes a container/service
# restart do not cause an unexpected outage, we drain
Expand Down
13 changes: 13 additions & 0 deletions playbooks/os-masakari-install.yml
Expand Up @@ -27,6 +27,14 @@
pacemaker_corosync_group: masakari_monitor
pacemaker_corosync_ring_interface: "{{ masakari_monitor_corosync_multicast_interface }}"
haveged_enabled: false
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
vars:
deployment_extra_facts_filter: "{{ 'ansible_' ~ pacemaker_corosync_ring_interface | replace('-','_') }}"
deployment_extra_facts_subset: "!all,network"
tags:
- always
roles:
- role: "pacemaker_corosync"
tags: pacemaker-corosync
Expand All @@ -39,6 +47,11 @@
- "defaults/repo_packages/openstack_services.yml"
- "defaults/{{ install_method }}_install.yml"
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

# In order to ensure that any container, software or
# config file changes which causes a container/service
# restart do not cause an unexpected outage, we drain
Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-mistral-install.yml
Expand Up @@ -30,6 +30,11 @@
tags:
- mistral
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-murano-install.yml
Expand Up @@ -29,6 +29,11 @@
tags:
- murano
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-octavia-install.yml
Expand Up @@ -30,6 +30,11 @@
tags:
- octavia
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-panko-install.yml
Expand Up @@ -29,6 +29,11 @@
tags:
- panko
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal
roles:
Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-placement-install.yml
Expand Up @@ -30,6 +30,11 @@
tags:
- placement
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-sahara-install.yml
Expand Up @@ -28,6 +28,11 @@
tags:
- sahara
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
when: not is_metal

Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-senlin-install.yml
Expand Up @@ -30,6 +30,11 @@
tags:
- senlin
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

# In order to ensure that any container, software or
# config file changes which causes a container/service
# restart do not cause an unexpected outage, we drain
Expand Down
5 changes: 5 additions & 0 deletions playbooks/os-swift-install.yml
Expand Up @@ -27,6 +27,11 @@
- "defaults/repo_packages/openstack_services.yml"
- "defaults/{{ install_method }}_install.yml"
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
tags:
- always

- include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml"
vars:
extra_container_config_no_restart:
Expand Down

0 comments on commit f89d87c

Please sign in to comment.