diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-10-10 23:09:52 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-10-10 23:09:52 +0300 |
| commit | e4faedce00a921ab3b58b816eda987feaa2f0e9e (patch) | |
| tree | b6f1fe4776eaaa30f5f15e37d4962ff72f85b851 | |
| parent | f4504129f6a1bfce8fc81f69b0f90f340acb1d34 (diff) | |
Stuff
| -rw-r--r-- | playbook.yml | 27 | ||||
| -rw-r--r-- | tasks/jail_ingress.yml | 3 | ||||
| -rw-r--r-- | tasks/network.yml | 17 | ||||
| -rw-r--r-- | templates/ingress/etc_crontab.j2 | 6 |
4 files changed, 29 insertions, 24 deletions
diff --git a/playbook.yml b/playbook.yml index 4f32363..81de8ca 100644 --- a/playbook.yml +++ b/playbook.yml @@ -39,19 +39,20 @@ jail_userland_version: 14.3-RELEASE jail_ingress_ip: "192.168.2.1" jails: - - { name: ingress, num: 1 } - - { name: postgres, num: 2 } - - { name: irc_thelounge, num: 3 } - - { name: taulubot, num: 4 } - - { name: veetibot, num: 5 } - - { name: hommabot, num: 6 } - - { name: aggro, num: 7 } - - { name: diddle, num: 8, tls: true } - - { name: gallery_sakari, num: 9 } - - { name: gallery_leo, num: 10 } - - { name: spliit, num: 11 } - - { name: stirling-pdf, num: 12 } - - { name: ente, num: 13 } + - { name: ingress, num: 1, tls: false } + - { name: postgres, num: 2, tls: false } + - { name: irc_thelounge, num: 3, tls: false } + - { name: taulubot, num: 4, tls: false } + - { name: veetibot, num: 5, tls: false } + - { name: hommabot, num: 6, tls: false } + - { name: aggro, num: 7, tls: false } + - { name: diddle, num: 8, tls: true, host: diddle.jan.systems } + - { name: gallery_sakari, num: 9, tls: false } + - { name: gallery_leo, num: 10, tls: false } + - { name: spliit, num: 11, tls: true, host: spliit.jan.systems } + - { name: stirling-pdf, num: 12, tls: false } + - { name: ente, num: 13, tls: false } + - { name: freshrss, num: 14, tls: true, host: freshrss.jan.systems } static_sites: - { site: "homepage", host: "jan.systems", tls: true } static_site_dirs: diff --git a/tasks/jail_ingress.yml b/tasks/jail_ingress.yml index 794c66a..78eb3e6 100644 --- a/tasks/jail_ingress.yml +++ b/tasks/jail_ingress.yml @@ -74,7 +74,8 @@ mode: "0644" vars: # comma-separated list of sites - items: "{{ static_sites | selectattr('tls') | map(attribute='host') | join(',') }}" + items_list: "{{ static_sites + jails }}" + items: "{{ items_list | selectattr('tls') | map(attribute='host') }}" register: jail_ingress_etc_crontab - name: Restart cron diff --git a/tasks/network.yml b/tasks/network.yml index 0e4a722..e9143bd 100644 --- a/tasks/network.yml +++ b/tasks/network.yml @@ -11,9 +11,10 @@ shell: chflags schg /etc/resolv.conf when: resolv_conf.changed -- name: Restart networking if interface configuration changed - shell: service netif restart && service routing restart - when: rc_conf.changed or resolv_conf.changed +# TODO: this doesn't work without rc_conf having been run +#- name: Restart networking if interface configuration changed +# shell: service netif restart && service routing restart +# when: rc_conf.changed or resolv_conf.changed - name: Set up sshd template: @@ -42,11 +43,11 @@ state: started register: started_syslogd -- name: Restart syslogd - service: - name: syslogd - state: restarted - when: not started_syslogd.changed and rc_conf.changed +#- name: Restart syslogd +# service: +# name: syslogd +# state: restarted +# when: not started_syslogd.changed and rc_conf.changed - name: Configure pf template: diff --git a/templates/ingress/etc_crontab.j2 b/templates/ingress/etc_crontab.j2 index 7308565..0ec694d 100644 --- a/templates/ingress/etc_crontab.j2 +++ b/templates/ingress/etc_crontab.j2 @@ -6,5 +6,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin # #minute hour mday month wday who command -# Update LetsEncrypt certificates every day at 2:00 AM -0 2 * * * root certbot certonly --nginx -n -m jan@jantuomi.fi --agree-tos -d {{ items }} +# Update LetsEncrypt certificates every day after 2:00 AM +{% for item in items %} +{{ loop.index0 }} 2 * * * root certbot certonly --nginx -n -m jan@jantuomi.fi --agree-tos -d {{ item }} +{% endfor %} |
