Skip to content

Commit 514713f

Browse files
authored
Merge pull request #376 from tobiashuste/skip-zammad-es-reindexing
Do not run search index rebuild by default
2 parents 48fc65b + 10195c3 commit 514713f

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

roles/zammad/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ elasticsearch_url: "http://localhost:9200"
124124

125125
Elasticsearch server address.
126126

127+
```yaml
128+
zammad_force_es_searchindex_rebuild: false
129+
```
130+
131+
By default, the Elasticsearch indexes are only rebuilt during the initial
132+
installation.
133+
Set this variable to `true` to force Ansible to trigger the rebuild of the
134+
Zammad search index when Zammad is updated.
135+
127136
## Dependencies
128137

129138
Zammad requires Elasticsearch and PostgreSQL database server.

roles/zammad/defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ zammad_ssl_key_path: "/etc/ssl/private/zammad_key.pem"
1515
zammad_nginx_additional_server_configs: []
1616
zammad_nginx_server_tokens: "off"
1717

18+
zammad_force_es_searchindex_rebuild: false
19+
1820
elasticsearch_url: "http://localhost:9200"
1921
...

roles/zammad/handlers/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
- name: "Build search index"
1818
ansible.builtin.command: "zammad run rake zammad:searchindex:rebuild"
1919
changed_when: true
20+
when: "not __zammad_is_installed or zammad_force_es_searchindex_rebuild"
2021

2122
...

roles/zammad/tasks/install.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@
4343
update_cache: true
4444
mode: "0644"
4545

46+
- name: "Gather the package facts to check wether Zammad has already been installed"
47+
ansible.builtin.package_facts:
48+
manager: "auto"
49+
50+
- name: "Check if Zammad is already installed"
51+
ansible.builtin.set_fact:
52+
__zammad_is_installed: "{{ 'zammad' in ansible_facts.packages }}"
53+
4654
- name: "Install | Install Zammad package"
4755
ansible.builtin.package:
4856
name: "zammad={{ zammad_version }}*"

0 commit comments

Comments
 (0)