Skip to content

Commit

Permalink
cleanup extra roles
Browse files Browse the repository at this point in the history
  • Loading branch information
DecFox committed Dec 5, 2024
1 parent 427b248 commit 04dbf7b
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 334 deletions.
18 changes: 11 additions & 7 deletions ansible/deploy-ooni-backend.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
---
- hosts: backend-hel.ooni.org
roles:
- role: base-bookworm
- role: bootstrap
- role: nftables
- role: nginx-buster
- role: nginx
tags: nginx
vars:
nginx_user: "www-data"
- role: dehydrated
tags: dehydrated
expand: yes
ssl_domains:
# with dehydrated the first entry is the cert FQDN
# and the other ones are alternative names
- "backend-hel.ooni.org"
vars:
ssl_domains:
# with dehydrated the first entry is the cert FQDN
# and the other ones are alternative names
- "backend-hel.ooni.org"
- role: ooni-backend
ssl_domain: backend-hel.ooni.org
vars:
ssl_domain: backend-hel.ooni.org
1 change: 1 addition & 0 deletions ansible/roles/base-backend/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Configure base host based on backend hosts
15 changes: 15 additions & 0 deletions ansible/roles/base-backend/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- name: reload nftables
tags: nftables
ansible.builtin.systemd_service:
name: nftables
state: reloaded

- name: restart chrony
ansible.builtin.systemd:
name: chrony.service
state: restarted

- name: restart netdata
ansible.builtin.systemd:
name: netdata.service
state: restarted
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
- name: motd
shell: echo "" > /etc/motd

- name: Set hostname
ansible.builtin.hostname:
name: "{{ inventory_hostname }}"

- name: Remove apt repo
tags: apt
file:
Expand Down Expand Up @@ -81,22 +77,6 @@
- tmux
- vim

- name: Configure journald
tags: journald
template:
src: templates/journald.conf
dest: /etc/systemd/journald.conf
mode: 0644
owner: root

- name: enable and restart journald
tags: journald
systemd:
name: systemd-journald.service
state: restarted
enabled: yes
daemon_reload: yes

- name: Autoremove
tags: autoremove
apt:
Expand All @@ -114,16 +94,8 @@
create: yes
block: |
add rule inet filter input ip saddr {{ lookup('dig', 'prometheus.ooni.org/A') }} tcp dport 19999 counter accept comment "netdata.service"
#- name: reload nftables service
# systemd:
# name: nftables.service
# state: reloaded
# enabled: yes
# daemon_reload: yes

- name: reload nftables service
service: name=nftables state=restarted
notify:
- reload nftables

- name: configure netdata.service
tags: netdata
Expand All @@ -144,12 +116,8 @@
tags: timezone
timezone:
name: Etc/UTC

- name: restart chrony service
tags: timezone
systemd:
name: chrony.service
state: restarted
notify:
- restart chrony

- name: configure netdata chrony
tags: netdata, timezone
Expand All @@ -168,54 +136,5 @@
path: /usr/lib/netdata/conf.d/python.d.conf
regexp: '^chrony:'
line: 'chrony: yes'

#- name: configure netdata nginx
# blockinfile:
# path: /etc/netdata/python.d/nginx.conf
# create: yes
# block: |
# # Managed by ansible, see roles/base-bookworm/tasks/main.yml
# update_every: 5
# nginx_log:
# name : 'nginx_log'
# path : '/var/log/nginx/access.log'

#- name: configure netdata haproxy
# blockinfile:
# path: /etc/netdata/python.d/haproxy.conf
# block: |
# # Managed by ansible, see roles/base-bookworm/tasks/main.yml
# update_every: 5
# via_url:
# url: 'http://127.0.0.1:7000/haproxy_stats;csv;norefresh'

- name: restart netdata service
tags: netdata, timezone
systemd:
name: netdata.service
state: restarted


- name: install systemd-resolved
tags: resolved
apt:
install_recommends: no
cache_valid_time: 86400
name:
- systemd-resolved

- name: configure systemd-resolved
tags: resolved
template:
src: resolved.conf
dest: /etc/systemd/resolved.conf

- name: restart systemd-resolved
tags: resolved
systemd:
name: systemd-resolved.service
state: restarted

- name: test systemd-resolved
tags: resolved
shell: resolvectl query go.dnscheck.tools --cache=no
notify:
- restart netdata
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# See roles/base-bookworm/templates/resolved.conf

[Resolve]
## https://meta.wikimedia.org/wiki/Wikimedia_DNS
DNS=185.71.138.138
DNS=9.9.9.9
FallbackDNS=1.1.1.1 8.8.8.8
DNSOverTLS=opportunistic
DNSSEC=allow-downgrade
Cache=yes
1 change: 0 additions & 1 deletion ansible/roles/base-bookworm/README.adoc

This file was deleted.

7 changes: 7 additions & 0 deletions ansible/roles/bootstrap/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
tags:
- nftables

- name: Set the backend host configuration if valid
when: inventory_hostname == 'backend-hel.ooni.org'
ansible.builtin.include_role:
name: base-backend
tags:
- base-backend

- name: Configure journald
tags:
- journald
Expand Down
25 changes: 0 additions & 25 deletions ansible/roles/nftables-sysadmin/README.adoc

This file was deleted.

49 changes: 0 additions & 49 deletions ansible/roles/nftables-sysadmin/tasks/main.yml

This file was deleted.

41 changes: 0 additions & 41 deletions ansible/roles/nftables-sysadmin/templates/nftables.conf

This file was deleted.

8 changes: 0 additions & 8 deletions ansible/roles/nginx-buster/files/ffdhe2048_dhparam.pem

This file was deleted.

3 changes: 0 additions & 3 deletions ansible/roles/nginx-buster/files/ssl_intermediate.conf

This file was deleted.

4 changes: 0 additions & 4 deletions ansible/roles/nginx-buster/files/ssl_modern.conf

This file was deleted.

6 changes: 0 additions & 6 deletions ansible/roles/nginx-buster/handlers/main.yml

This file was deleted.

33 changes: 0 additions & 33 deletions ansible/roles/nginx-buster/tasks/main.yml

This file was deleted.

Loading

0 comments on commit 04dbf7b

Please sign in to comment.