-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
47 lines (42 loc) · 1.15 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
- hosts: all
gather_facts: False
pre_tasks:
- name: Install python for Ansible
raw: sudo bash -c "test -e /usr/bin/python || (apt -qqy update && apt install -qy python-minimal)"
register: output
changed_when: output.stdout != ""
- setup: # aka gather_facts
roles:
- common
- hosts: ctf-web
pre_tasks:
- name: include common vars
include_vars: vars/common.yml
- name: check files/letsencrypt
local_action: stat
path=files/letsencrypt/
register: lefiles
- name: synchronize /etc/letsencrypt
become: yes
tags: lesync
synchronize:
src: files/letsencrypt/
dest: /etc/letsencrypt/
delete: yes
checksum: yes
mode: push
when: lefiles.stat.exists and lefiles.stat.isdir
roles:
- role: web
- role: ansible-letsencrypt
letsencrypt_webroot_path: /var/www/html
letsencrypt_email: admin@{{ domain }}
letsencrypt_cert_domains:
- "{{ domain }}"
- www.{{ domain }}
#- chal.{{ domain }}
letsencrypt_renewal_command_args: '--renew-hook "systemctl restart nginx"'
- hosts: ctf-chal
roles:
- chal