migrate http_redirect on update
This commit is contained in:
@@ -17,6 +17,29 @@
|
|||||||
name: roles/system
|
name: roles/system
|
||||||
tasks_from: check-disk-utilization.yaml
|
tasks_from: check-disk-utilization.yaml
|
||||||
|
|
||||||
|
- name: Check if redirect.conf exists
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ mailcow_dir_result.files[0].path }}/data/conf/nginx/redirect.conf"
|
||||||
|
register: redirect_conf
|
||||||
|
when: mailcow_conf.stat.exists
|
||||||
|
|
||||||
|
- name: Delete redirect.conf if it exists
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ mailcow_dir_result.files[0].path }}/data/conf/nginx/redirect.conf"
|
||||||
|
state: absent
|
||||||
|
when: redirect_conf.stat.exists
|
||||||
|
|
||||||
- name: Update mailcow
|
- name: Update mailcow
|
||||||
shell: "cd {{ mailcow_dir_result.files[0].path }} && git fetch && git checkout origin/master update.sh && ./update.sh --force"
|
shell: "cd {{ mailcow_dir_result.files[0].path }} && git fetch && git checkout origin/master update.sh && ./update.sh --force"
|
||||||
when: local_mailcow_version.stdout != github_mailcow_ver and mailcow_conf.stat.exists and disk_space_output.stdout | bool
|
when: local_mailcow_version.stdout != github_mailcow_ver and mailcow_conf.stat.exists and disk_space_output.stdout | bool
|
||||||
|
|
||||||
|
- name: Update HTTP_REDIRECT in mailcow.conf if redirect.conf existed
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: "{{ mailcow_dir_result.files[0].path }}/mailcow.conf"
|
||||||
|
regexp: '^HTTP_REDIRECT='
|
||||||
|
line: 'HTTP_REDIRECT=y'
|
||||||
|
when: redirect_conf.stat.exists
|
||||||
|
|
||||||
|
- name: Restart mailcow services
|
||||||
|
ansible.builtin.shell: "cd {{ mailcow_dir_result.files[0].path }} && docker compose up -d"
|
||||||
|
when: redirect_conf.stat.exists
|
||||||
|
|||||||
Reference in New Issue
Block a user