blob: a6fdc3cad83381857dcfe832a467cc9de1e4d77b (
plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
- name: Set WAN hooks (test)
set_fact:
exec_prestart:
- "ifconfig epw{{ jail_num }}a destroy 2>/dev/null || true"
- "ifconfig epair{{ jail_num }}001 create"
- "ifconfig epair{{ jail_num }}001a name epw{{ jail_num }}a"
- "ifconfig epair{{ jail_num }}001b name epw{{ jail_num }}b"
- "ifconfig brlan0 addm epw{{ jail_num }}a"
exec_poststart:
- "ifconfig epw{{ jail_num }}b vnet {{ jail_name }}"
- "ifconfig epw{{ jail_num }}a up"
- "jexec {{ jail_name }} ifconfig epw{{ jail_num }}b up"
- "jexec {{ jail_name }} ifconfig epw{{ jail_num }}b inet {{ ingress_wan_static }}"
- "jexec {{ jail_name }} route add default {{ lan_ipv4_gateway }}"
exec_poststop:
- "ifconfig epw{{ jail_num }}a destroy 2>/dev/null || true"
when: not is_prod
- name: Set WAN hooks (prod)
set_fact:
exec_prestart:
- "ifconfig epw{{ jail_num }}a destroy 2>/dev/null || true"
- "ifconfig epair{{ jail_num }}001 create"
- "ifconfig epair{{ jail_num }}001a name epw{{ jail_num }}a"
- "ifconfig epair{{ jail_num }}001b name epw{{ jail_num }}b"
- "ifconfig brwan0 addm epw{{ jail_num }}a"
exec_poststart:
- "ifconfig epw{{ jail_num }}b vnet {{ jail_name }}"
- "ifconfig epw{{ jail_num }}a up"
- "jexec {{ jail_name }} ifconfig epw{{ jail_num }}b up"
- "jexec {{ jail_name }} dhclient epw{{ jail_num }}b"
- "jexec {{ jail_name }} route add 10.6.210.0/24 {{ lan_ipv4_gateway }} || true"
exec_poststop:
- "ifconfig epw{{ jail_num }}a destroy 2>/dev/null || true"
when: is_prod
- import_role:
name: jail
tasks_from: jail_setup
- name: Deploy nginx config
template:
src: "{{ jail_role_dir }}/templates/usr_local_etc_nginx_nginx.conf.j2"
dest: /usr/local/etc/nginx/nginx.conf
owner: root
group: wheel
mode: "0644"
notify: Reload nginx
- name: Check if TLS certs exist
stat:
path: "/usr/local/etc/letsencrypt/live/{{ cert_name }}"
register: _certbot_certs
when: is_prod
- name: Pause for manual certbot setup
pause:
prompt: "Run certbot manually in the ingress jail to obtain certs, then press Enter."
when: is_prod and not (_certbot_certs.stat.exists | default(true))
- import_role:
name: jail
tasks_from: jail_launch
|