Created
December 26, 2017 10:37
-
-
Save stintel/9852a215c87bf6852ffb8923ecb3d92b to your computer and use it in GitHub Desktop.
zimbracert.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: facts | |
vars: | |
cfiles: | |
- src: certs/{{ zimbra__fqdn }}.crt | |
dest: /opt/zimbra/ssl/zimbra/commercial/commercial.crt | |
- src: certs/{{ zimbra__fqdn }}.pem | |
dest: /opt/zimbra/ssl/zimbra/commercial/commercial.key | |
hosts: mail | |
tasks: | |
- name: copy cert/key | |
copy: | |
src: "{{ item.src }}" | |
dest: "{{ item.dest }}" | |
with_items: "{{ cfiles }}" | |
register: certs | |
- name: zmcertmgr | |
shell: "/opt/zimbra/bin/zmcertmgr deploycrt comm /opt/zimbra/ssl/zimbra/commercial/commercial.crt /opt/zimbra/ssl/zimbra/commercial/commercial_ca.crt" | |
when: certs.changed | |
register: certmgr | |
- name: zmcertmgr output | |
debug: | |
msg: "{{ certmgr }}" | |
- name: restart services | |
shell: "/opt/zimbra/bin/{{ item }} restart" | |
when: certs.changed | |
with_items: | |
- zmmailboxdctl | |
- zmproxyctl | |
become: yes | |
become_user: zimbra |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment