diff --git a/README.md b/README.md index ed3cd9c..ac04dd7 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ zm_repo: ``` * **disable_existing_dns_stub_listener:** Inform "y" to disable the systemd-resolved DNS stub listener and free up port 53. Default: **n** +* **zimbra_upgrade:** Inform "y" to upgrade an existing Zimbra installation. Zimbra will be upgraded to **zimbra_version** version. Default: **n** + Service Variables - Inform "y" or "n" -------------- diff --git a/defaults/main.yml b/defaults/main.yml index f819fa1..670ab97 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -39,9 +39,10 @@ zmnetwork: "192.168.200.0/8" timezone: UTC #hosts_lines: # - "198.162.1.3 {{ hostname }}.{{ domain }} {{ hostname }}" +disable_existing_dns_stub_listener: n # -# Zimbra repository +# Zimbra installers ################################################################################ zimbra_version: 8.8.15 @@ -62,4 +63,5 @@ zm_repo: 6: zcs-8.8.15_GA_3869.RHEL6_64.20190918004220 7: zcs-8.8.15_GA_3869.RHEL7_64.20190918004220 8: zcs-8.8.15_GA_3953.RHEL8_64.20200629025823 -disable_existing_dns_stub_listener: n + +zimbra_upgrade: false \ No newline at end of file diff --git a/tasks/install/zimbra.yml b/tasks/install/zimbra.yml index 5f07580..6658fc8 100644 --- a/tasks/install/zimbra.yml +++ b/tasks/install/zimbra.yml @@ -29,7 +29,7 @@ - name: Uploading keystroke file template: - src: 'installZimbra-keystrokes' + src: "{{ 'installZimbra-keystrokes' if not zimbra_upgrade else 'installZimbraUpgrade-keystrokes' }}" dest: /tmp/zcs/installZimbra-keystrokes owner: root group: root @@ -37,7 +37,7 @@ - name: Uploading installer configuration file template: - src: 'installZimbraScript.j2' + src: "{{ 'installZimbraScript.j2' if not zimbra_upgrade else 'installZimbraScriptUpgrade.j2' }}" dest: /tmp/zcs/installZimbraScript owner: root group: root diff --git a/tasks/main.yml b/tasks/main.yml index f577fe9..7a417bc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,9 +11,9 @@ # Installation process ################################################################################ - import_tasks: 'install/dependencies.yml' - when: getent_passwd.rc == 2 + when: getent_passwd.rc == 2 or zimbra_upgrade - import_tasks: 'install/zimbra.yml' - when: getent_passwd.rc == 2 + when: getent_passwd.rc == 2 or zimbra_upgrade - import_tasks: 'install/policyd.yml' when: zimbra_policyd == 'y' @@ -21,11 +21,11 @@ # Configuration process ################################################################################ - import_tasks: 'configure/proxy.yml' - when: zimbra_proxy == 'y' + when: zimbra_proxy == 'y' and not zimbra_upgrade - import_tasks: 'configure/mailbox.yml' - when: zimbra_store == 'y' + when: zimbra_store == 'y' and not zimbra_upgrade - import_tasks: 'configure/mta.yml' - when: zimbra_mta == 'y' + when: zimbra_mta == 'y' and not zimbra_upgrade - import_tasks: 'configure/disable_existing_dns_stub_listener.yml' when: zimbra_dnscache == 'y' and disable_existing_dns_stub_listener == 'y' diff --git a/templates/installZimbraScriptUpgrade.j2 b/templates/installZimbraScriptUpgrade.j2 new file mode 100644 index 0000000..8d584ce --- /dev/null +++ b/templates/installZimbraScriptUpgrade.j2 @@ -0,0 +1 @@ +zimbraNotifyInstall=no \ No newline at end of file diff --git a/templates/installZimbraUpgrade-keystrokes b/templates/installZimbraUpgrade-keystrokes new file mode 100644 index 0000000..3524cf2 --- /dev/null +++ b/templates/installZimbraUpgrade-keystrokes @@ -0,0 +1,5 @@ +y +n +y +y +y \ No newline at end of file