2020-07-10 00:58:55 +02:00
|
|
|
# vim:syntax=yaml
|
|
|
|
---
|
|
|
|
{%- from "acme/map.jinja" import acme with context %}
|
|
|
|
acme-install:
|
|
|
|
cmd.run:
|
|
|
|
- name: "curl https://get.acme.sh | sh"
|
|
|
|
- runas: root
|
|
|
|
- cwd: /root
|
|
|
|
- env:
|
|
|
|
- HOME: /root
|
|
|
|
- unless: /bin/bash -c "[[ -f /root/.acme.sh/acme.sh ]]"
|
|
|
|
|
|
|
|
acme-upgrade:
|
|
|
|
cmd.run:
|
|
|
|
- name: /root/.acme.sh/acme.sh --upgrade
|
|
|
|
- runas: root
|
|
|
|
- cwd: /root
|
|
|
|
- env:
|
|
|
|
- HOME: /root
|
|
|
|
- require:
|
|
|
|
- cmd: acme-install
|
|
|
|
|
|
|
|
{%- for dir in acme.directories %}
|
|
|
|
acme-directories-{{ dir }}:
|
|
|
|
file.directory:
|
|
|
|
- name: {{ dir }}
|
2020-09-12 17:41:35 +02:00
|
|
|
- makedirs: true
|
2020-07-10 00:58:55 +02:00
|
|
|
{%- endfor %}
|
|
|
|
|
|
|
|
acme-dh-params:
|
|
|
|
cmd.run:
|
|
|
|
- name: openssl dhparam -out {{ acme.dh.path }} {{ acme.dh.keysize }}
|
|
|
|
- creates: {{ acme.dh.path }}
|
|
|
|
|
|
|
|
acme-certs:
|
|
|
|
cmd.run:
|
2020-10-03 09:17:15 +02:00
|
|
|
- name: /root/.acme.sh/acme.sh --debug --issue {%- for dom in acme.domains %} -d '{{ dom }}' {% endfor -%} --dns dns_ovh --cert-file '' --key-file '{{ acme.keyfile }}' --fullchain-file '{{ acme.fullchainfile }}' -k {{ acme.keysize }}
|
2020-07-10 00:58:55 +02:00
|
|
|
- env:
|
|
|
|
- OVH_AK: '{{ acme.provider.api.application_key }}'
|
|
|
|
- OVH_AS: '{{ acme.provider.api.application_secret }}'
|
|
|
|
- OVH_CK: '{{ acme.provider.api.consumer_key }}'
|
|
|
|
- HOME: '/root'
|
|
|
|
- success_retcodes:
|
|
|
|
- 0
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
- runas: root
|
|
|
|
- cwd: /root
|
|
|
|
- require:
|
2020-10-03 09:17:15 +02:00
|
|
|
- cmd: acme-install
|