Browse Source

Make some roles more generic

* Renaming of,
  ** undercloud_ram -> check_ram
  ** undercloud_cpu -> check_cpu
  ** undercloud_disk_space -> check_disk_space
  ** undercloud_service_status -> check_service_status
  ** undercloud_selinux_mode -> check_selinux_mode

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
changes/52/712252/1
Gael Chamoulaud (Strider) 2 years ago
parent
commit
bdb1d57c2e
No known key found for this signature in database GPG Key ID: 4119D0305C651D66
  1. 0
      validations_common/roles/check_cpu/README.md
  2. 2
      validations_common/roles/check_cpu/defaults/main.yml
  3. 0
      validations_common/roles/check_cpu/molecule/default/Dockerfile.j2
  4. 0
      validations_common/roles/check_cpu/molecule/default/molecule.yml
  5. 6
      validations_common/roles/check_cpu/molecule/default/playbook.yml
  6. 7
      validations_common/roles/check_cpu/tasks/main.yml
  7. 0
      validations_common/roles/check_disk_space/defaults/main.yml
  8. 0
      validations_common/roles/check_disk_space/molecule/default/Dockerfile.j2
  9. 0
      validations_common/roles/check_disk_space/molecule/default/molecule.yml
  10. 2
      validations_common/roles/check_disk_space/molecule/default/playbook.yml
  11. 0
      validations_common/roles/check_disk_space/tasks/main.yml
  12. 0
      validations_common/roles/check_ram/README.md
  13. 2
      validations_common/roles/check_ram/defaults/main.yml
  14. 0
      validations_common/roles/check_ram/molecule/default/Dockerfile.j2
  15. 0
      validations_common/roles/check_ram/molecule/default/molecule.yml
  16. 6
      validations_common/roles/check_ram/molecule/default/playbook.yml
  17. 9
      validations_common/roles/check_ram/tasks/main.yml
  18. 0
      validations_common/roles/check_selinux_mode/molecule/default/Dockerfile.j2
  19. 1
      validations_common/roles/check_selinux_mode/molecule/default/molecule.yml
  20. 0
      validations_common/roles/check_selinux_mode/molecule/default/playbook.yml
  21. 0
      validations_common/roles/check_selinux_mode/tasks/main.yml
  22. 2
      validations_common/roles/check_service_status/defaults/main.yml
  23. 2
      validations_common/roles/check_service_status/tasks/main.yml
  24. 3
      validations_common/roles/undercloud_cpu/defaults/main.yml
  25. 7
      validations_common/roles/undercloud_cpu/tasks/main.yml
  26. 10
      validations_common/roles/undercloud_cpu/vars/main.yaml
  27. 36
      validations_common/roles/undercloud_disk_space/README.md
  28. 11
      validations_common/roles/undercloud_disk_space/vars/main.yaml
  29. 3
      validations_common/roles/undercloud_ram/defaults/main.yml
  30. 9
      validations_common/roles/undercloud_ram/tasks/main.yml
  31. 11
      validations_common/roles/undercloud_ram/vars/main.yaml
  32. 37
      validations_common/roles/undercloud_selinux_mode/README.md
  33. 8
      validations_common/roles/undercloud_selinux_mode/vars/main.yml
  34. 38
      validations_common/roles/undercloud_service_status/README.md
  35. 8
      validations_common/roles/undercloud_service_status/vars/main.yaml

0
validations_common/roles/undercloud_cpu/README.md → validations_common/roles/check_cpu/README.md

2
validations_common/roles/check_cpu/defaults/main.yml

@ -0,0 +1,2 @@
---
minimal_cpu_count: 8

0
validations_common/roles/undercloud_cpu/molecule/default/Dockerfile.j2 → validations_common/roles/check_cpu/molecule/default/Dockerfile.j2

0
validations_common/roles/undercloud_cpu/molecule/default/molecule.yml → validations_common/roles/check_cpu/molecule/default/molecule.yml

6
validations_common/roles/undercloud_cpu/molecule/default/playbook.yml → validations_common/roles/check_cpu/molecule/default/playbook.yml

@ -19,12 +19,12 @@
hosts: all
vars:
min_undercloud_cpu_count: 100
minimal_cpu_count: 100
tasks:
- block:
- include_role:
name: undercloud_cpu
name: check_cpu
rescue:
- name: Clear host errors
meta: clear_host_errors
@ -38,5 +38,5 @@
- name: Fail the test
fail:
msg: |
The undercloud_cpu role should have detected that there is not
The check_cpu role should have detected that there is not
enough CPU

7
validations_common/roles/check_cpu/tasks/main.yml

@ -0,0 +1,7 @@
---
- name: Verify the number of CPU cores
fail:
msg: >-
There are {{ ansible_processor_vcpus }} cores in the system,
but there should be at least {{ minimal_cpu_count }}
failed_when: "ansible_processor_vcpus|int < minimal_cpu_count|int"

0
validations_common/roles/undercloud_disk_space/defaults/main.yml → validations_common/roles/check_disk_space/defaults/main.yml

0
validations_common/roles/undercloud_disk_space/molecule/default/Dockerfile.j2 → validations_common/roles/check_disk_space/molecule/default/Dockerfile.j2

0
validations_common/roles/undercloud_disk_space/molecule/default/molecule.yml → validations_common/roles/check_disk_space/molecule/default/molecule.yml

2
validations_common/roles/undercloud_disk_space/molecule/default/playbook.yml → validations_common/roles/check_disk_space/molecule/default/playbook.yml

@ -27,7 +27,7 @@
tasks:
- block:
- include_role:
name: undercloud_disk_space
name: check_disk_space
rescue:
- name: Clear host errors
meta: clear_host_errors

0
validations_common/roles/undercloud_disk_space/tasks/main.yml → validations_common/roles/check_disk_space/tasks/main.yml

0
validations_common/roles/undercloud_ram/README.md → validations_common/roles/check_ram/README.md

2
validations_common/roles/check_ram/defaults/main.yml

@ -0,0 +1,2 @@
---
minimal_ram_gb: 24

0
validations_common/roles/undercloud_ram/molecule/default/Dockerfile.j2 → validations_common/roles/check_ram/molecule/default/Dockerfile.j2

0
validations_common/roles/undercloud_ram/molecule/default/molecule.yml → validations_common/roles/check_ram/molecule/default/molecule.yml

6
validations_common/roles/undercloud_ram/molecule/default/playbook.yml → validations_common/roles/check_ram/molecule/default/playbook.yml

@ -19,12 +19,12 @@
hosts: all
vars:
min_undercloud_ram_gb: 1000000
minimal_ram_gb: 1000000
tasks:
- block:
- include_role:
name: undercloud_ram
name: check_ram
rescue:
- name: Clear host errors
meta: clear_host_errors
@ -38,5 +38,5 @@
- name: Fail the test
fail:
msg: |
The undercloud_ram role should have detected that there is not
The check_ram role should have detected that there is not
enough RAM

9
validations_common/roles/check_ram/tasks/main.yml

@ -0,0 +1,9 @@
---
- name: Verify the RAM requirements
fail:
msg: >-
The RAM on the system is {{ ansible_memtotal_mb }} MB,
the minimal recommended value is
{{ minimal_ram_gb|int * 1024 }} MB.
# NOTE(shadower): converting GB to MB
failed_when: "(ansible_memtotal_mb) < minimal_ram_gb|int * 1024"

0
validations_common/roles/undercloud_selinux_mode/molecule/default/Dockerfile.j2 → validations_common/roles/check_selinux_mode/molecule/default/Dockerfile.j2

1
validations_common/roles/undercloud_selinux_mode/molecule/default/molecule.yml → validations_common/roles/check_selinux_mode/molecule/default/molecule.yml

@ -27,7 +27,6 @@ provisioner:
log: true
env:
ANSIBLE_STDOUT_CALLBACK: yaml
ANSIBLE_LIBRARY: "../../../../library"
scenario:
test_sequence:

0
validations_common/roles/undercloud_selinux_mode/molecule/default/playbook.yml → validations_common/roles/check_selinux_mode/molecule/default/playbook.yml

0
validations_common/roles/undercloud_selinux_mode/tasks/main.yml → validations_common/roles/check_selinux_mode/tasks/main.yml

2
validations_common/roles/undercloud_service_status/defaults/main.yml → validations_common/roles/check_service_status/defaults/main.yml

@ -1,5 +1,5 @@
---
undercloud_service_list:
check_service_list:
- tripleo_nova_compute
- tripleo_heat_engine
- tripleo_ironic_conductor

2
validations_common/roles/undercloud_service_status/tasks/main.yml → validations_common/roles/check_service_status/tasks/main.yml

@ -2,7 +2,7 @@
- name: Check Services are running
command: "/usr/bin/systemctl show {{ item }} --property ActiveState"
become: true
with_items: "{{ undercloud_service_list }}"
with_items: "{{ check_service_list }}"
register: "check_services"
changed_when: false
ignore_errors: true

3
validations_common/roles/undercloud_cpu/defaults/main.yml

@ -1,3 +0,0 @@
---
min_undercloud_cpu_count: 8

7
validations_common/roles/undercloud_cpu/tasks/main.yml

@ -1,7 +0,0 @@
---
- name: Verify the number of CPU cores
fail:
msg: >-
There are {{ ansible_processor_vcpus }} cores in the system,
but there should be at least {{ min_undercloud_cpu_count }}
failed_when: "ansible_processor_vcpus|int < min_undercloud_cpu_count|int"

10
validations_common/roles/undercloud_cpu/vars/main.yaml

@ -1,10 +0,0 @@
---
metadata:
name: Verify undercloud fits the CPU core requirements
description: >
Make sure that the undercloud has enough CPU cores.
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Undercloud_Requirements.html
groups:
- prep
- pre-introspection

36
validations_common/roles/undercloud_disk_space/README.md

@ -1,36 +0,0 @@
Undercloud-disk-space
=====================
An Ansible role to verify if the Undercloud fits the disk space requirements.
Requirements
------------
This role could be used before or/and after the Undercloud installation.
Role Variables
--------------
- Volumes: a dictionary of mount points and their minimum sizes
Dependencies
------------
No Dependencies
Example Playbook
----------------
- hosts: servers
roles:
- { role: undercloud-disk-space}
License
-------
Apache
Author Information
------------------
Red Hat TripleO Validation Team

11
validations_common/roles/undercloud_disk_space/vars/main.yaml

@ -1,11 +0,0 @@
---
metadata:
name: Verify undercloud fits the disk space requirements
description: >
Make sure that the root partition on the undercloud node has enough
free space.
http://tripleo.org/install/environments/baremetal.html#minimum-system-requirements
groups:
- prep
- pre-introspection

3
validations_common/roles/undercloud_ram/defaults/main.yml

@ -1,3 +0,0 @@
---
min_undercloud_ram_gb: 24

9
validations_common/roles/undercloud_ram/tasks/main.yml

@ -1,9 +0,0 @@
---
- name: Verify the RAM requirements
fail:
msg: >-
The RAM on the undercloud node is {{ ansible_memtotal_mb }} MB,
the minimal recommended value is
{{ min_undercloud_ram_gb|int * 1024 }} MB.
# NOTE(shadower): converting GB to MB
failed_when: "(ansible_memtotal_mb) < min_undercloud_ram_gb|int * 1024"

11
validations_common/roles/undercloud_ram/vars/main.yaml

@ -1,11 +0,0 @@
---
metadata:
name: Verify the undercloud fits the RAM requirements
description: >
Verify that the undercloud has enough RAM.
https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/14/html/director_installation_and_usage/planning-your-undercloud#determining-environment-scale
groups:
- prep
- pre-introspection
- pre-upgrade

37
validations_common/roles/undercloud_selinux_mode/README.md

@ -1,37 +0,0 @@
Undercloud-selinux-mode
=======================
An Ansible role to check the Undercloud SELinux Enforcing mode
Requirements
------------
This role could be used before or/and after the Undercloud installation
Role Variables
--------------
None
Dependencies
------------
No dependencies.
Example Playbook
----------------
- hosts: undercloud
roles:
- { role: undercloud-selinux-mode }
License
-------
Apache
Author Information
------------------
Red Hat TripleO Validations Team

8
validations_common/roles/undercloud_selinux_mode/vars/main.yml

@ -1,8 +0,0 @@
---
metadata:
name: Undercloud SELinux Enforcing Mode Check
description: >
Check if the Undercloud is running SELinux in Enforcing mode.
groups:
- prep
- pre-introspection

38
validations_common/roles/undercloud_service_status/README.md

@ -1,38 +0,0 @@
Undercloud-service-status
=========================
An Ansible role to verify the Undercloud services states before running an
Update or Upgrade.
Requirements
------------
This role needs to be run against an installed Undercloud.
Role Variables
--------------
- undercloud_service_list: A list of services actually coming from the tripleo-ansible-inventory
Dependencies
------------
No dependencies.
Example Playbook
----------------
- hosts: undercloud
roles:
- { role: undercloud-service-status }
License
-------
Apache
Author Information
------------------
Red Hat TripleO Validations Team.

8
validations_common/roles/undercloud_service_status/vars/main.yaml

@ -1,8 +0,0 @@
---
metadata:
name: Verify undercloud services state before running update or upgrade
description: >
Check undercloud status before running a stack update - especially minor update and major upgrade.
groups:
- post-upgrade
- pre-upgrade
Loading…
Cancel
Save