main.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. - name: Verify if slurm-exporter is already installed
  16. command: ls /usr/bin/prometheus-slurm-exporter
  17. register: slurm_exporter_status
  18. changed_when: false
  19. failed_when: false
  20. - name: Install slurm exporter
  21. include_tasks: install_slurm_exporter.yml
  22. when: "'No such file or directory' in slurm_exporter_status.stderr"
  23. - name: Start slurm exporter services
  24. include_tasks: start_services.yml
  25. - name: Verify if kubernetes is already installed
  26. command: ls /usr/bin/kubectl
  27. register: k8s_installation_status
  28. changed_when: false
  29. failed_when: false
  30. - name: Install prometheus on host
  31. include_tasks: install_prometheus.yml
  32. when:
  33. - "'kubernetes' in ansible_skip_tags"
  34. - "'No such file' in k8s_installation_status.stderr"