diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg new file mode 100644 index 000000000..40a0fc9c5 --- /dev/null +++ b/ansible/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +callback_plugins = plugins/callback/ diff --git a/ansible/check/group_vars/all b/ansible/check/group_vars/all index 9ea8f2591..b7c4c11d8 100644 --- a/ansible/check/group_vars/all +++ b/ansible/check/group_vars/all @@ -1,2 +1,4 @@ --- ansible_sudo: yes + +# vi:syntax=yaml diff --git a/ansible/check/group_vars/compute b/ansible/check/group_vars/compute index dc7e04e39..3fb381d4b 100644 --- a/ansible/check/group_vars/compute +++ b/ansible/check/group_vars/compute @@ -1,3 +1,28 @@ --- reserved_host_memory_check: 2048 tuned_profile: virtual-host +nova_vif_timeout: 300 + +checks: + bz1245714: + url: "https://bugzilla.redhat.com/show_bug.cgi?id=1245714" + name: "No Swap Space allocated" + bz1282644: + url : "https://bugzilla.redhat.com/show_bug.cgi?id=1282644" + name : "increase reserved_host_memory_mb" + tuned_profile_result : + url: "none" + name: "Ensure Tuned Profile is set to {{ tuned_profile }}" + nova_vif_timeout_result: + url: "none" + name: "Nova VIF timeout should be >= 300" +# neutron_nova_creds: +# url: "https://bugzilla.redhat.com/show_bug.cgi?id=1264740" +# name: "RHEL OSP Director must be configure with nova-event-callback by default" + bz1264740: + url: "https://bugzilla.redhat.com/show_bug.cgi?id=1264740" + name: "RHEL OSP Director must be configure with nova-event-callback by default" + + + +# vi:syntax=yaml diff --git a/ansible/check/group_vars/controller b/ansible/check/group_vars/controller index fc63032ac..4e4250ee6 100644 --- a/ansible/check/group_vars/controller +++ b/ansible/check/group_vars/controller @@ -3,3 +3,32 @@ tuned_profile: throughput-performance rabbitmq_fd: 1600 haproxy_max_connections: 4096 mariadb_max_connections: 4096 +nova_vif_timeout: 300 + +checks : + bz1282491 : + url: "https://bugzilla.redhat.com/show_bug.cgi?id=1282491" + name: "update default file descriptor setting" + bz1281584 : + url: "https://bugzilla.redhat.com/show_bug.cgi?id=1281584" + name: "Director does not create an haproxy configuration that conforms to our best-practice recommendations" + bz1266253 : + url: "https://bugzilla.redhat.com/show_bug.cgi?id=1266253" + name: "increase mariadb max_connection default value" + nova_vif_timeout_result: + url: "none" + name: "Nova VIF timeout should be >= 300" +# neutron_nova_creds: +# url: "https://bugzilla.redhat.com/show_bug.cgi?id=1264740" +# name: "RHEL OSP Director must be configure with nova-event-callback by default" + bz1264740: + url: "https://bugzilla.redhat.com/show_bug.cgi?id=1264740" + name: "RHEL OSP Director must be configure with nova-event-callback by default" + rabbit_partitioned : + url: "none" + name: "Rabbit is currently partitioned - YMMV... Good luck." + tuned_profile_result : + url: "none" + name: "Ensure Tuned Profile is set to {{ tuned_profile }}" + +# vi:syntax=yaml diff --git a/ansible/check/roles/common/tasks/main.yml b/ansible/check/roles/common/tasks/main.yml index fb41ed218..7f5fbd929 100644 --- a/ansible/check/roles/common/tasks/main.yml +++ b/ansible/check/roles/common/tasks/main.yml @@ -17,8 +17,8 @@ - name: Check tuned for correct profile on host command: tuned-adm active - register: tuned_stdout + register: tuned_profile_result changed_when: no - failed_when: "'{{ tuned_profile }}' not in '{{ tuned_result.stdout }}'" + failed_when: "'{{ tuned_profile }}' not in '{{ tuned_profile_result.stdout }}'" ignore_errors: True diff --git a/ansible/check/roles/compute/tasks/main.yml b/ansible/check/roles/compute/tasks/main.yml index 98902550c..d6dcbaa53 100644 --- a/ansible/check/roles/compute/tasks/main.yml +++ b/ansible/check/roles/compute/tasks/main.yml @@ -5,15 +5,15 @@ - name: Check if swap device exists command: swapon -s - register: swap_result + register: bz1245714 changed_when: no - failed_when: "'dev' not in '{{ swap_result.stdout }}'" + failed_when: "'dev' not in '{{ bz1245714.stdout }}'" ignore_errors: True - 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 + register: bz1282644 + failed_when: bz1282644.stdout|int < reserved_host_memory_check changed_when: no ignore_errors: True diff --git a/ansible/check/roles/controller/tasks/main.yml b/ansible/check/roles/controller/tasks/main.yml index 4f13a94a4..2007187aa 100644 --- a/ansible/check/roles/controller/tasks/main.yml +++ b/ansible/check/roles/controller/tasks/main.yml @@ -3,29 +3,29 @@ # Performance checks specific to controller hosts # -- name: Check max_connections +- name: Check max_connections on the database shell: mysql -e "show variables like 'max_connections';" | grep max_connections | awk '{print $2}' - register: max_connections + register: bz1266253 changed_when: no - failed_when: max_connections.stdout|int < mariadb_max_connections + failed_when: bz1266253.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_result + register: bz1282491 changed_when: no - failed_when: rabbitmq_fd_result.stdout|int < rabbitmq_fd + failed_when: bz1282491.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 - failed_when: haproxy_maxconn.stdout|int < mariadb_max_connections + register: bz1281584 + failed_when: bz1281584.stdout|int < mariadb_max_connections changed_when: no ignore_errors: yes - name : Check rabbitmq for partitions shell: rabbitmqctl cluster_status | grep partitions -A 1 | grep -q controller - register: rabbitmq_partition_result + register: rabbit_partitioned changed_when: no - failed_when: rabbitmq_partition_result.rc == 0 + failed_when: rabbit_partitioned.rc == 0 diff --git a/ansible/check/roles/neutron/tasks/main.yaml b/ansible/check/roles/neutron/tasks/main.yaml new file mode 100644 index 000000000..196622344 --- /dev/null +++ b/ansible/check/roles/neutron/tasks/main.yaml @@ -0,0 +1,7 @@ +--- +- name: Check nova is configured in neutron config + command: crudini --get /etc/neutron/neutron.conf DEFAULT nova_admin_tenant_id + register: neutron_nova_creds + failed_when: neutron_nova_creds.rc == 1 + changed_when: false + ignore_errors: True diff --git a/ansible/check/roles/nova/tasks/main.yaml b/ansible/check/roles/nova/tasks/main.yaml new file mode 100644 index 000000000..e5b94b3e0 --- /dev/null +++ b/ansible/check/roles/nova/tasks/main.yaml @@ -0,0 +1,14 @@ +--- +- name: Check Nova vif_plugging + command: crudini --get /etc/nova/nova.conf DEFAULT vif_plugging_is_fatal + register: bz1264740 + failed_when: "'True' not in '{{ bz1264740.stdout }}'" + changed_when: false + ignore_errors: True + +- name: Check Nova vif_plugging_timeout + command: crudini --get /etc/nova/nova.conf DEFAULT vif_plugging_timeout + register: nova_vif_timeout_result + failed_when: nova_vif_timeout > nova_vif_timeout_result.stdout|int + changed_when: false + ignore_errors: True diff --git a/ansible/check/site.yml b/ansible/check/site.yml index f9e69d3a3..d1e3aaa56 100644 --- a/ansible/check/site.yml +++ b/ansible/check/site.yml @@ -5,20 +5,30 @@ - hosts: controller remote_user: heat-admin - vars: roles: - common - controller - keystone + - neutron + - nova - hosts: compute remote_user: heat-admin roles: - common - compute + - nova - hosts: ceph remote_user: heat-admin roles: - common - ceph + +- hosts: all + gather_facts: False + become: false + sudo: false + name: Generating bug report + tasks: + - local_action: template src=templates/bug_report.j2 dest=./bug_report.log diff --git a/ansible/check/templates/bug_report.j2 b/ansible/check/templates/bug_report.j2 new file mode 100644 index 000000000..310f9ad48 --- /dev/null +++ b/ansible/check/templates/bug_report.j2 @@ -0,0 +1,28 @@ +# Browbeat generated bug report +{% for host in groups['controller'] %} +--------------------------------------- +| Issues for host : {{ host }} +--------------------------------------- +{% for check in hostvars[host]['checks'] %} +{% if hostvars[host][check]['failed'] == true %} +Bug: {{ check }} +Name: {{ hostvars[host]['checks'][check]['name'] }} +URL: {{ hostvars[host]['checks'][check]['url'] }} + +{% endif %} +{% endfor %} +{% endfor %} + +{% for host in groups['compute'] %} +--------------------------------------- +| Issues for host : {{ host }} +--------------------------------------- +{% for check in hostvars[host]['checks'] %} +{% if hostvars[host][check]['failed'] == true %} +Bug: {{ check }} +Name: {{ hostvars[host]['checks'][check]['name'] }} +URL: {{ hostvars[host]['checks'][check]['url'] }} + +{% endif %} +{% endfor %} +{% endfor %}