diff --git a/ansible/check/group_vars/ceph b/ansible/check/group_vars/ceph new file mode 100644 index 000000000..c3ca9fa8a --- /dev/null +++ b/ansible/check/group_vars/ceph @@ -0,0 +1,2 @@ +--- +tuned_profile: throughput-performance diff --git a/ansible/check/group_vars/compute b/ansible/check/group_vars/compute new file mode 100644 index 000000000..dc7e04e39 --- /dev/null +++ b/ansible/check/group_vars/compute @@ -0,0 +1,3 @@ +--- +reserved_host_memory_check: 2048 +tuned_profile: virtual-host diff --git a/ansible/check/group_vars/controller b/ansible/check/group_vars/controller new file mode 100644 index 000000000..fc63032ac --- /dev/null +++ b/ansible/check/group_vars/controller @@ -0,0 +1,5 @@ +--- +tuned_profile: throughput-performance +rabbitmq_fd: 1600 +haproxy_max_connections: 4096 +mariadb_max_connections: 4096 diff --git a/ansible/check/roles/ceph/tasks/main.yml b/ansible/check/roles/ceph/tasks/main.yml index e77a2f068..3ae3dddf7 100644 --- a/ansible/check/roles/ceph/tasks/main.yml +++ b/ansible/check/roles/ceph/tasks/main.yml @@ -13,15 +13,13 @@ - name: Verify RBD caching shell: ceph --admin-daemon `ls /var/run/ceph/ceph-osd.*.asok|tail -1` config show|grep '"rbd_cache":'|grep -i true|awk '{print tolower($0)}' register: ceph_rbd_caching + failed_when : "'true' not in '{{ ceph_rbd_caching.stdout }}'" changed_when: false ignore_errors: True - name: Verify RBD cache writethrough shell: ceph --admin-daemon `ls /var/run/ceph/ceph-osd.*.asok|tail -1` config show|grep "rbd_cache_writethrough"|grep -i true|awk '{print tolower($0)}' register: ceph_rbd_cache_writethrough + failed_when: "'false' not in '{{ ceph_rbd_cache_writethrough.stdout }}'" changed_when: false ignore_errors: True - -- set_fact: - ceph_rbd_cache_writethrough_result : "{{ ceph_rbd_cache_writethrough.stdout }}" - ceph_rbd_caching_result : "{{ ceph_rbd_caching.stdout }}" diff --git a/ansible/check/roles/common/tasks/main.yml b/ansible/check/roles/common/tasks/main.yml index aa66ece3a..fb41ed218 100644 --- a/ansible/check/roles/common/tasks/main.yml +++ b/ansible/check/roles/common/tasks/main.yml @@ -19,8 +19,6 @@ command: tuned-adm active register: tuned_stdout changed_when: no + failed_when: "'{{ tuned_profile }}' not in '{{ tuned_result.stdout }}'" ignore_errors: True -- set_fact: - tuned_result : "{{ tuned_stdout.stdout }}" - diff --git a/ansible/check/roles/compute/tasks/main.yml b/ansible/check/roles/compute/tasks/main.yml index 2e1c806c5..98902550c 100644 --- a/ansible/check/roles/compute/tasks/main.yml +++ b/ansible/check/roles/compute/tasks/main.yml @@ -13,9 +13,7 @@ - name: Check reserved_host_memory_mb shell: grep reserved_host_memory /etc/nova/nova.conf | grep -v "#" | cut -f2 -d = register: reserved_host_memory + failed_when: reserved_host_memory.stdout|int < reserved_host_memory_check changed_when: no ignore_errors: True -- name : Validate reserved_host_memory_mb - set_fact: - reserved_host_memory_result : "{{ reserved_host_memory.stdout }}" diff --git a/ansible/check/roles/controller/tasks/main.yml b/ansible/check/roles/controller/tasks/main.yml index c1d1efb39..4f13a94a4 100644 --- a/ansible/check/roles/controller/tasks/main.yml +++ b/ansible/check/roles/controller/tasks/main.yml @@ -5,31 +5,24 @@ - name: Check max_connections shell: mysql -e "show variables like 'max_connections';" | grep max_connections | awk '{print $2}' - register: max_connections_stdout + register: max_connections changed_when: no -# failed_when: max_connections_result.stdout|int < mariadb_max_connections - ignore_errors: True - -- set_fact : - max_connections_result: "{{ max_connections_stdout.stdout }}" + failed_when: max_connections.stdout|int < mariadb_max_connections + ignore_errors: yes - name : Check rabbitmq file descriptors shell: rabbitmqctl status | grep file_descriptors | awk -F',' '{print $3}' | sed 's/.$//' - register: rabbitmq_fd_stdout + register: rabbitmq_fd_result changed_when: no -# failed_when: rabbitmq_fd_result.stdout|int < rabbitmq_fd - ignore_errors: True - -- set_fact : - rabbitmq_fd_result : "{{ rabbitmq_fd_stdout.stdout }}" + failed_when: rabbitmq_fd_result.stdout|int < rabbitmq_fd + ignore_errors: yes - name : Check HAProxy Default maxconn shell : cat /etc/haproxy/haproxy.cfg | grep -iPzo '(?s)defaults.*?\n(\n|$)' | grep maxconn | awk '{print $2}' - register: haproxy_maxconn_stdout + register: haproxy_maxconn + failed_when: haproxy_maxconn.stdout|int < mariadb_max_connections changed_when: no - -- set_fact : - haproxy_maxconn_result: "{{ haproxy_maxconn_stdout.stdout }}" + ignore_errors: yes - name : Check rabbitmq for partitions shell: rabbitmqctl cluster_status | grep partitions -A 1 | grep -q controller diff --git a/ansible/check/roles/keystone/tasks/main.yml b/ansible/check/roles/keystone/tasks/main.yml index 01eb836ad..4469ca633 100644 --- a/ansible/check/roles/keystone/tasks/main.yml +++ b/ansible/check/roles/keystone/tasks/main.yml @@ -22,7 +22,7 @@ shell: ps afx | grep "[Kk]eystone-all" -c register: keystone_in_eventlet changed_when: false - ignore_errors: true + ignore_errors: True - name: Set keystone_deployment variable to httpd set_fact: keystone_deployment='httpd' diff --git a/ansible/check/site.yml b/ansible/check/site.yml index dffc7d8a9..f9e69d3a3 100644 --- a/ansible/check/site.yml +++ b/ansible/check/site.yml @@ -22,91 +22,3 @@ roles: - common - ceph - -# -# Generate Report of Checks -# -- hosts : controller - name : Report for Controller(s) - gather_facts: false - vars: - tuned_profile: throughput-performance - rabbitmq_fd: 1600 - haproxy_max_connections: 4096 - mariadb_max_connections: 4096 - tasks : - - name : Check Controller Tuned profile - fail: - msg: "Incorrect tuned profile for Controller" - when: "'{{ tuned_profile }}' not in '{{ hostvars[item].tuned_result }}'" - with_items: groups['controller'] - ignore_errors: true - - - name : Check Controller rabbitmq file descriptors - fail : - msg: "Expecting {{ rabbitmq_fd }} fds, found {{ hostvars[item].rabbitmq_fd_result }}" - when: hostvars[item].rabbitmq_fd_result|int < rabbitmq_fd - with_items: groups['controller'] - ignore_errors: true - - - name : Check Controller database connections - fail : - msg: "Expecting {{ mariadb_max_connections }} connections, found {{ hostvars[item].max_connections_result }}" - when: hostvars[item].max_connections_result|int < mariadb_max_connections - with_items: groups['controller'] - ignore_errors: true - - - name : Check Controller haproxy max connections - fail : - msg: "Expecting {{ haproxy_max_connections }} connections, found {{ hostvars[item].haproxy_maxconn_result }}" - when: hostvars[item].haproxy_maxconn_result|int < haproxy_max_connections - with_items: groups['controller'] - ignore_errors: true - -- hosts : compute - name : Report for Compute(s) - gather_facts: false - vars: - reserved_host_memory_check: 2048 - tuned_profile: virtual-host - tasks : - - name : Report Compute(s) reserved_host_memory - fail: - msg: "Compute node reserved memory too low - https://bugzilla.redhat.com/show_bug.cgi?id=1282644" - when: hostvars[item].reserved_host_memory|int < reserved_host_memory_check - with_items: groups['compute'] - ignore_errors: true - - - name : Check Compute Tuned profile - fail: - msg: "Incorrect tuned profile for Compute - https://bugzilla.redhat.com/show_bug.cgi?id=1246645" - when: "'{{ tuned_profile }}' not in '{{ hostvars[item].tuned_result }}'" - with_items: groups['compute'] - ignore_errors: true - -- hosts : ceph - name : Report for Ceph(s) - gather_facts: false - vars: - tuned_profile: throughput-performance - tasks : - - name : Check Ceph Tuned profile - fail: - msg: "Incorrect tuned profile for Ceph" - when: "'{{ tuned_profile }}' not in '{{ hostvars[item].tuned_result }}'" - with_items: groups['ceph'] - ignore_errors: true - - - name : Verify RBD caching - fail : - msg: "Verify RBD caching check failed" - when : "'true' not in '{{ hostvars[item].ceph_rbd_caching_result }}'" - with_items: groups['ceph'] - ignore_errors: true - - - name : Verify RBD cache writethrough - fail: - msg: "Verify RBD cache writethrough check failed" - when: "'false' not in '{{ hostvars[item].ceph_rbd_cache_writethrough_result }}'" - with_items: groups['ceph'] - ignore_errors: true