Skip to content

Instantly share code, notes, and snippets.

@ahnooie
Created January 20, 2019 05:07
Show Gist options
  • Save ahnooie/f674ac98ea8adb3909bae65f5ecf37ed to your computer and use it in GitHub Desktop.
Save ahnooie/f674ac98ea8adb3909bae65f5ecf37ed to your computer and use it in GitHub Desktop.
Ansible Playbook to update Proxmox SSL Certs from dehydrated Let's Encrypt
# installs and updates proxmox SSL certs from a local directory on ansible and restarts pveproxy
# ansible-playbook proxmox-ssl.yml
- hosts: proxmox
become: yes
tasks:
- name: Copy SSL certificate to proxmox
copy:
dest: /etc/pve/local/pveproxy-ssl.pem
src: "/etc/dehydrated/certs/{{ item }}/fullchain.pem"
follow: yes
with_items: "{{ dehydrated_ssl_certs }}"
register: sslcert
- name: Copy SSL key to proxmox
copy:
dest: /etc/pve/local/pveproxy-ssl.key
src: "/etc/dehydrated/certs/{{ item }}/privkey.pem"
follow: yes
with_items: "{{ dehydrated_ssl_certs }}"
register: sslkey
- name: Restart pveproxy when certs change
service: name=pveproxy state=restarted
when: sslcert.changed or sslkey.changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment