paulbsd-salt/states/acme/acmesh.sls
Paul Lecuq 2e7242c9f3
All checks were successful
continuous-integration/drone/push Build is passing
linted states
2022-06-10 00:39:52 +02:00

48 lines
1.1 KiB
YAML

# vim:syntax=yaml
{%- from "acme/map.jinja" import acme with context %}
---
acmesh-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 ]]"
acmesh-upgrade:
cmd.run:
- name: /root/.acme.sh/acme.sh --upgrade
- runas: root
- cwd: /root
- env:
- HOME: /root
- require:
- cmd: acmesh-install
acmesh-run:
cmd.run:
- name: >
/root/.acme.sh/acme.sh --debug --issue
{%- for domain in acme.domains %}
-d '{{ domain }}'
{% endfor -%}
--dns dns_ovh
--cert-file ''
--fullchain-file '{{ acme.fullcertfile }}'
--key-file '{{ acme.keyfile }}'
-k {{ acme.keysize }}
- 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:
- cmd: acmesh-install