Skip to content

Commit e655530

Browse files
committed
(broken) auto lets encrypt via acme state
1 parent 1db665f commit e655530

File tree

2 files changed

+105
-0
lines changed

2 files changed

+105
-0
lines changed

pillar/dev/top.sls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ base:
88
- tls
99
- users.*
1010
- postgres.clusters
11+
- pebble # needing to do this to have pebble rum in dev
1112

1213
'backup-server':
1314
- match: nodegroup

salt/tls/init.sls

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
include:
2+
- .pebble
3+
- .lego
4+
15
ssl-cert:
26
pkg.installed
37

8+
certbot:
9+
pkg.installed
410

511
{% for name in salt["pillar.get"]("tls:ca", {}) %} # " Syntax Hack
612
/etc/ssl/certs/{{ name }}.pem:
@@ -25,3 +31,101 @@ ssl-cert:
2531
- require:
2632
- pkg: ssl-cert
2733
{% endfor %}
34+
35+
# initial test
36+
{% if grains['id'] == 'salt.nyc1.psf.io' or grains['id'] == 'salt-master.vagrant.psf.io' %}
37+
pypa.io:
38+
acme.cert:
39+
40+
- webroot: /etc/lego
41+
- renew: 14
42+
{% if pillar["dc"] == "vagrant" %}
43+
- server: https://salt-master.vapsf.io:14000/dir
44+
{% endif %}
45+
- require:
46+
- sls: tls.lego
47+
- file: /etc/lego/.well-known/acme-challenge
48+
49+
# DNS-validated domains
50+
# dns plugins do not exist yet for route53 & gandi
51+
{#star.python.org:#}
52+
{# acme.cert:#}
53+
{# - aliases:#}
54+
{# - python.org#}
55+
{# - email: [email protected]#}
56+
{## - dns_plugin: route53#}
57+
{## - dns_plugin_credentials: route53.python#}
58+
{# - renew: 14#}
59+
{# - server: https://localhost:14000/dir#}
60+
{# - require:#}
61+
{# - pkg: certbot#}
62+
{#
63+
- sls: tls.lego#}
64+
{#star.pycon.org:#}
65+
{# acme.cert:#}
66+
{# - aliases:#}
67+
{# - pycon.org#}
68+
{# - email: [email protected]#}
69+
{## - dns_plugin: route53#}
70+
{## - dns_plugin_credentials: route53.pycon#}
71+
{# - renew: 14#}
72+
{# - server: https://localhost:14000/dir#}
73+
{# - require:#}
74+
{# - sls: tls.lego#}
75+
76+
{#star.pyfound.org:#}
77+
{# acme.cert:#}
78+
{# - aliases:#}
79+
{# - pyfound.org#}
80+
{# - email: [email protected]#}
81+
{## - dns_plugin: gandiv5#}
82+
{## - dns_plugin_credentials: gandi#}
83+
{# - renew: 14#}
84+
{# - require:#}
85+
{# - sls: tls.lego#}
86+
87+
# HTTP-validated domains
88+
{#{% for domain in [#}
89+
{# 'pypa.io',#}
90+
{# 'www.pycon.org',#}
91+
{# 'speed.pypy.org',#}
92+
{# 'salt-public.psf.io',#}
93+
{# 'planetpython.org',#}
94+
{# 'bugs.python.org'#}
95+
{#] %}#}
96+
{#{{ domain }}:#}
97+
{# acme.cert:#}
98+
{# - email: [email protected]#}
99+
{# - webroot: /etc/lego#}
100+
{# - renew: 14#}
101+
{# - require:#}
102+
{# - sls: tls.lego#}
103+
{#{% endfor %}#}
104+
105+
# Multi-domain certificates
106+
{#jython.org:#}
107+
{# acme.cert:#}
108+
{# - aliases:#}
109+
{# - www.jython.net#}
110+
{# - jython.net#}
111+
{# - www.jython.com#}
112+
{# - jython.com#}
113+
{# - email: [email protected]#}
114+
{# - webroot: /etc/lego#}
115+
{# - renew: 14#}
116+
{# - require:#}
117+
{# - sls: tls.lego#}
118+
119+
{#bugs.python.org-multi:#}
120+
{# acme.cert:#}
121+
{# - name: bugs.python.org#}
122+
{# - aliases:#}
123+
{# - bugs.jython.org#}
124+
{# - issues.roundup-tracker.org#}
125+
{# - mail.roundup-tracker.org#}
126+
{# - email: [email protected]#}
127+
{# - webroot: /etc/lego#}
128+
{# - renew: 14#}
129+
{# - require:#}
130+
{# - sls: tls.lego#}
131+
{% endif %}

0 commit comments

Comments
 (0)