ansible-role-openstreamingp.../tasks/tls.yml

44 lines
890 B
YAML
Raw Permalink Normal View History

2020-12-09 00:25:50 +01:00
- name: Install
package:
name: dehydrated
- name: create folders
file:
path: "{{ item }}"
state: directory
with_items:
- /etc/nginx/sites.d
- /etc/nginx/local.d
- /etc/nginx/snippets
- name: create folders
file:
path: "/srv/http/.well-known/acme-challenge"
state: directory
- name: templates
notify: reload nginx
template:
src: "{{ item.file }}"
dest: "/etc/nginx/{{ item.path }}"
with_items:
- file: letsencrypt.nginx
path: snippets/letsencrypt.conf
- name: config dehydrated
template:
src: dehydrated
dest: /etc/dehydrated/config
- name: get let's encrypt account
command: /usr/bin/dehydrated --register --accept-terms
args:
creates: /etc/dehydrated/accounts
2020-12-09 10:53:14 +01:00
- name: get osp_hostname cert
2020-12-09 00:25:50 +01:00
notify: dehydrated
lineinfile:
path: /etc/dehydrated/domains.txt
line: "{{ osp_hostname }}"
create: yes