Skip to content

Instantly share code, notes, and snippets.

@stintel
Created December 26, 2017 10:37
Show Gist options
  • Save stintel/9852a215c87bf6852ffb8923ecb3d92b to your computer and use it in GitHub Desktop.
Save stintel/9852a215c87bf6852ffb8923ecb3d92b to your computer and use it in GitHub Desktop.
zimbracert.yml
---
- 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