test_slurm_exporter_inst_host.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. # OMNIA_PSE_TC_002
  16. # Install prometheus on host when kubernetes is not installed
  17. - name: OMNIA_PSE_TC_002
  18. hosts: manager
  19. vars_files:
  20. - test_vars/test_slurmexporter_vars.yml
  21. tasks:
  22. - block:
  23. - name: Call install slurm exporter role
  24. include_role:
  25. name: ../roles/slurm_exporter
  26. tags: TC_002
  27. - name: Verify slurm exporter status
  28. systemd:
  29. name: prometheus-slurm-exporter
  30. register: slurm_exporter_status
  31. tags: TC_002, VERIFY_002
  32. - name: Validate slurm exporter service status
  33. assert:
  34. that:
  35. - slurm_exporter_status.status.ActiveState == 'active'
  36. fail_msg: "{{ slurm_exporter_service_fail_msg }}"
  37. success_msg: "{{ slurm_exporter_service_success_msg }}"
  38. tags: TC_002, VERIFY_002
  39. - name: Verify prometheus installation status
  40. command: prometheus --version
  41. register: prometheus_status
  42. tags: TC_002, VERIFY_002
  43. ignore_errors: yes
  44. changed_when: False
  45. - name: Validate prometheus version command
  46. assert:
  47. that:
  48. - "'Command not found' not in prometheus_status.stdout"
  49. fail_msg: "{{ prometheus_installation_fail_msg }}"
  50. success_msg: "{{ prometheus_installation_success_msg }}"
  51. tags: TC_002, VERIFY_002