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>
This commit is contained in:
parent
ba5e10832e
commit
bdb1d57c2e
2
validations_common/roles/check_cpu/defaults/main.yml
Normal file
2
validations_common/roles/check_cpu/defaults/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
minimal_cpu_count: 8
|
@ -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
Normal file
7
validations_common/roles/check_cpu/tasks/main.yml
Normal file
@ -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"
|
@ -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
|
2
validations_common/roles/check_ram/defaults/main.yml
Normal file
2
validations_common/roles/check_ram/defaults/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
minimal_ram_gb: 24
|
@ -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
Normal file
9
validations_common/roles/check_ram/tasks/main.yml
Normal file
@ -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"
|
@ -27,7 +27,6 @@ provisioner:
|
||||
log: true
|
||||
env:
|
||||
ANSIBLE_STDOUT_CALLBACK: yaml
|
||||
ANSIBLE_LIBRARY: "../../../../library"
|
||||
|
||||
scenario:
|
||||
test_sequence:
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
undercloud_service_list:
|
||||
check_service_list:
|
||||
- tripleo_nova_compute
|
||||
- tripleo_heat_engine
|
||||
- tripleo_ironic_conductor
|
@ -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
|
@ -1,3 +0,0 @@
|
||||
---
|
||||
|
||||
min_undercloud_cpu_count: 8
|
@ -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"
|
@ -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
|
@ -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
|
@ -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
|
@ -1,3 +0,0 @@
|
||||
---
|
||||
|
||||
min_undercloud_ram_gb: 24
|
@ -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"
|
@ -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
|
@ -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
|
@ -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
|
@ -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.
|
@ -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…
x
Reference in New Issue
Block a user