|
20 | 20 | tasks:
|
21 | 21 | - include_role:
|
22 | 22 | name: slurm_stats
|
| 23 | + tasks_from: "{{ 'configure.yml' if appliances_mode == 'configure' else 'main.yml' }}" |
23 | 24 |
|
24 | 25 | - name: Deploy filebeat
|
25 | 26 | hosts: filebeat
|
26 | 27 | tags: filebeat
|
27 | 28 | tasks:
|
28 |
| - - import_role: |
| 29 | + - include_role: |
29 | 30 | name: filebeat
|
| 31 | + tasks_from: "{{ 'runtime.yml' if appliances_mode == 'configure' else 'main.yml' }}" |
30 | 32 |
|
31 | 33 | - name: Deploy node_exporter
|
32 | 34 | hosts: node_exporter
|
33 | 35 | tags: node_exporter
|
34 | 36 | tasks:
|
35 |
| - - import_role: name=cloudalchemy.node_exporter |
| 37 | + - import_role: |
| 38 | + name: cloudalchemy.node_exporter |
36 | 39 |
|
37 | 40 | - name: Deploy OpenOndemand exporter
|
38 | 41 | hosts: openondemand
|
|
46 | 49 | tasks_from: exporter.yml
|
47 | 50 |
|
48 | 51 | - name: Deploy Slurm exporter
|
49 |
| - hosts: control |
| 52 | + hosts: slurm_exporter |
50 | 53 | become: true
|
51 | 54 | tags: slurm_exporter
|
52 | 55 | tasks:
|
53 |
| - - import_role: |
| 56 | + - include_role: |
54 | 57 | name: slurm_exporter
|
| 58 | + tasks_from: "{{ 'configure.yml' if appliances_mode == 'configure' else 'main.yml' }}" |
55 | 59 |
|
56 | 60 | - name: Setup core monitoring software
|
57 | 61 | hosts: prometheus
|
|
68 | 72 | # i.e. if prometheus_version isn't defined we don't care, so use what's already there
|
69 | 73 | set_fact:
|
70 | 74 | prometheus_skip_install: "{{ false if prometheus_version is defined else true }}"
|
71 |
| - when: "{{ (prometheus_binaries.results | map(attribute='stat') | map(attribute='exists')) + [prometheus_skip_install is not defined] }}" |
| 75 | + when: "(prometheus_binaries.results | map(attribute='stat') | map(attribute='exists')) + [prometheus_skip_install is not defined]" |
72 | 76 | - import_role:
|
73 | 77 | name: cloudalchemy.prometheus
|
74 | 78 |
|
75 | 79 | - name: Deploy grafana
|
76 | 80 | hosts: grafana
|
77 | 81 | tags: grafana
|
78 | 82 | tasks:
|
79 |
| - - assert: |
80 |
| - that: vault_grafana_admin_password is defined |
81 |
| - fail_msg: "Must define vault_grafana_admin_password - use `ansible-playbook generate-passwords.yml` to generate a set of passwords" |
| 83 | + - name: Skip plugin installation in configure mode |
| 84 | + # done during fatimage - can't do this in vars block as that is recursive |
| 85 | + ansible.builtin.set_fact: |
| 86 | + grafana_plugins: "{{ [] if appliances_mode == 'configure' else grafana_plugins }}" |
| 87 | + - name: Copy Grafana plugins installed in image into persistent grafana state |
| 88 | + ansible.builtin.copy: |
| 89 | + remote_src: true |
| 90 | + src: /var/lib/grafana/plugins/ # trailing / means copy contents |
| 91 | + dest: "{{ grafana_data_dir }}/plugins/" |
| 92 | + # below matches what already exists: |
| 93 | + owner: root |
| 94 | + group: root |
| 95 | + mode: '0755' |
| 96 | + become: true |
82 | 97 | - include_role:
|
83 | 98 | name: cloudalchemy.grafana
|
84 | 99 | vars:
|
85 |
| - # We use internal roles to register the dashboards as the role does not support all options that we require. |
| 100 | + # Internal role used to install dashboards as cloudalchemy role does not support all required options: |
86 | 101 | grafana_dashboards: []
|
87 |
| - - import_role: # done in same play so it can use handlers from cloudalchemy.grafana |
| 102 | + - include_role: # done in same play so it can use handlers from cloudalchemy.grafana |
88 | 103 | name: grafana-dashboards
|
| 104 | + when: "appliances_mode != 'configure'" |
89 | 105 |
|
90 | 106 | - name: Deploy alertmanager
|
91 | 107 | hosts: alertmanager
|
|
0 commit comments