forked from infra/ansible
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
a9899061d8 |
3
roles/pizza/defaults/main.yml
Normal file
3
roles/pizza/defaults/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
|
||||
pizza_domain: pizza.binary.kitchen
|
7
roles/pizza/handlers/main.yml
Normal file
7
roles/pizza/handlers/main.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Restart nginx
|
||||
service: name=nginx state=restarted
|
||||
|
||||
- name: Run acertmgr
|
||||
command: /usr/bin/acertmgr
|
4
roles/pizza/meta/main.yml
Normal file
4
roles/pizza/meta/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- { role: acertmgr }
|
15
roles/pizza/tasks/main.yml
Normal file
15
roles/pizza/tasks/main.yml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
#- name: Ensure certificates are available
|
||||
# command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ pizza_domain }}.key -out /etc/nginx/ssl/{{ pizza_domain }}.crt -days 730 -subj "/CN={{ pizza_domain }}" creates=/etc/nginx/ssl/{{ pizza_domain }}.crt
|
||||
# notify: Restart nginx
|
||||
|
||||
- name: Request nsupdate key for certificate
|
||||
include_role: name=acme-dnskey-generate
|
||||
vars:
|
||||
acme_dnskey_san_domains:
|
||||
- "{{ pizza_domain }}"
|
||||
|
||||
- name: Configure certificate manager for pizza
|
||||
template: src=certs.j2 dest=/etc/acertmgr/{{ pizza_domain }}.conf
|
||||
notify: Run acertmgr
|
18
roles/pizza/templates/certs.j2
Normal file
18
roles/pizza/templates/certs.j2
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
|
||||
{{ pizza_domain }}:
|
||||
- mode: dns.nsupdate
|
||||
nsupdate_server: {{ acme_dnskey_server }}
|
||||
nsupdate_keyfile: {{ acme_dnskey_file }}
|
||||
- path: /etc/nginx/ssl/{{ pizza_domain }}.key
|
||||
user: root
|
||||
group: root
|
||||
perm: '400'
|
||||
format: key
|
||||
action: '/usr/sbin/service nginx restart'
|
||||
- path: /etc/nginx/ssl/{{ pizza_domain }}.crt
|
||||
user: root
|
||||
group: root
|
||||
perm: '400'
|
||||
format: crt,ca
|
||||
action: '/usr/sbin/service nginx restart'
|
Loading…
Reference in New Issue
Block a user