Created
January 20, 2019 05:07
-
-
Save ahnooie/f674ac98ea8adb3909bae65f5ecf37ed to your computer and use it in GitHub Desktop.
Ansible Playbook to update Proxmox SSL Certs from dehydrated Let's Encrypt
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
# 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