|
18 | 18 | alloy_version: "{{ __github_latest_version.json.tag_name | regex_replace('^v?(\\d+\\.\\d+\\.\\d+)$', '\\1') }}" |
19 | 19 |
|
20 | 20 | - name: Verify current deployed version |
21 | | - when: ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 21 | + when: ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
22 | 22 | block: |
23 | 23 | - name: Check if Alloy binary is present |
24 | 24 | ansible.builtin.stat: |
|
62 | 62 | file: setup-Darwin.yml |
63 | 63 | when: ansible_facts['os_family'] == 'Darwin' |
64 | 64 |
|
| 65 | +- name: Include SUSE setup |
| 66 | + ansible.builtin.include_tasks: |
| 67 | + file: setup-Suse.yml |
| 68 | + when: ansible_facts['os_family'] == 'Suse' |
| 69 | + |
65 | 70 | - name: Alloy systemd override |
66 | 71 | when: |
67 | 72 | - alloy_systemd_override | length > 0 |
68 | | - - ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 73 | + - ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
69 | 74 | block: |
70 | 75 | - name: Ensure that Alloy systemd override path exist |
71 | 76 | ansible.builtin.file: |
|
93 | 98 | group: "root" |
94 | 99 | mode: "0644" |
95 | 100 | notify: restart alloy |
96 | | - when: ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 101 | + when: ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
97 | 102 |
|
98 | 103 | - name: Template Alloy config - /etc/alloy/config.alloy |
99 | 104 | ansible.builtin.template: |
|
105 | 110 | when: |
106 | 111 | - alloy_config | length > 0 |
107 | 112 | - alloy_env_file_vars.CONFIG_FILE is not defined |
108 | | - - ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 113 | + - ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
109 | 114 | notify: restart alloy |
110 | 115 |
|
111 | 116 | - name: Ensure that /etc/alloy/alloy.config is absent when a custom configuration file/dir is specified in alloy_env_file_vars.CONFIG_FILE |
|
114 | 119 | state: absent |
115 | 120 | when: |
116 | 121 | - alloy_config | length < 1 or alloy_env_file_vars.CONFIG_FILE is defined |
117 | | - - ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 122 | + - ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
118 | 123 |
|
119 | 124 | - name: Add the Alloy system user to additional group |
120 | 125 | ansible.builtin.user: |
|
127 | 132 | loop: "{{ alloy_user_groups }}" |
128 | 133 | when: |
129 | 134 | - alloy_user_groups | length > 0 |
130 | | - - ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 135 | + - ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
131 | 136 |
|
132 | 137 | - name: Get firewalld state |
133 | 138 | ansible.builtin.systemd: |
134 | 139 | name: "firewalld" |
135 | 140 | register: __firewalld_service_state |
136 | | - when: ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 141 | + when: ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
137 | 142 |
|
138 | 143 | - name: Enable firewalld rule to expose Alloy tcp port {{ __alloy_server_http_listen_port }} |
139 | 144 | ansible.posix.firewalld: |
|
142 | 147 | port: "{{ __alloy_server_http_listen_port }}/tcp" |
143 | 148 | state: enabled |
144 | 149 | when: |
145 | | - - ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 150 | + - ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
146 | 151 | - __firewalld_service_state.status.ActiveState == "active" |
147 | 152 | - alloy_expose_port | bool |
148 | 153 |
|
|
155 | 160 | state: started |
156 | 161 | when: |
157 | 162 | - not ansible_check_mode |
158 | | - - ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 163 | + - ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
159 | 164 |
|
160 | 165 | - name: Verify that Alloy URL is responding |
161 | 166 | ansible.builtin.uri: |
|
168 | 173 | until: __alloy_verify_url_status_code.status == 200 |
169 | 174 | when: |
170 | 175 | - not ansible_check_mode |
171 | | - - ansible_facts['os_family'] in ['RedHat', 'Debian'] |
| 176 | + - ansible_facts['os_family'] in ['RedHat', 'Debian', 'Suse'] |
0 commit comments