Skip to content

Commit

Permalink
Fix/airflow tls (#177)
Browse files Browse the repository at this point in the history
Fixes: #176
  • Loading branch information
hellais authored Feb 3, 2025
1 parent c99fc56 commit 2556928
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 26 deletions.
6 changes: 6 additions & 0 deletions ansible/deploy-airflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
- data1.htz-fsn.prod.ooni.nu
become: true
roles:
- nginx
- dehydrated
- oonidata_airflow
vars:
airflow_public_fqdn: "airflow.prod.ooni.io"
tls_cert_dir: /var/lib/dehydrated/certs
ssl_domains:
- "data1.htz-fsn.prod.ooni.nu"
- "airflow.prod.ooni.io"
12 changes: 6 additions & 6 deletions ansible/roles/dehydrated/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Installs packages
tags: dehydrated
apt:
install_recommends: no
install_recommends: false
cache_valid_time: 86400
name:
- dehydrated
Expand All @@ -24,25 +24,25 @@

- name: Add ACME dedicated sites-enabled file
tags: dehydrated
template:
ansible.builtin.template:
src: templates/letsencrypt-http
# the server block matches all SSL FQDNs and must be
# parsed first, hence 00-
dest: /etc/nginx/sites-enabled/00-letsencrypt-http
mode: 0644
mode: "0644"
owner: root

- name: Add canary file to ensure /.well-known/acme-challenge is reachable by let's encrypt
tags: dehydrated
copy:
ansible.builtin.copy:
content: |
Generated by ansible using ansible/roles/dehydrated/tasks/main.yml.
Also, meow!!!
dest: /var/lib/dehydrated/acme-challenges/ooni-acme-canary
mode: 0644
mode: "0644"
owner: root
notify:
notify:
- reload nginx

- name: reload nftables service
Expand Down
28 changes: 8 additions & 20 deletions ansible/roles/oonidata_airflow/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
- name: Ensure Airflow group
group:
ansible.builtin.group:
name: "airflow"
become: true

# TODO: uncomment this section if you want to redeploy it
# this was added after the user had already been created by the airflow_role
# and so it's failing because it's trying to modify the user.
#- name: Ensure Airflow user
# user:
# ansible.builtin.user:
# name: "airflow"
# group: "airflow"
# system: true
Expand All @@ -18,12 +18,14 @@

- name: Checkout oonidata repo
become_user: airflow
become: true
ansible.builtin.git:
repo: 'https://github.com/ooni/data.git'
repo: "https://github.com/ooni/data.git"
dest: /opt/airflow/oonidata
version: main

- ansible.builtin.include_role:
- name: Install airflow
ansible.builtin.include_role:
name: ooni.airflow_role
tags:
- oonidata
Expand Down Expand Up @@ -58,23 +60,9 @@
ansible.builtin.file:
path: /opt/oonidata
state: directory
mode: '0755'
mode: "0755"
owner: airflow
recurse: yes

- ansible.builtin.include_role:
name: nginx
tags:
- oonidata
- nginx

- ansible.builtin.include_role:
name: dehydrated
tags:
- oonidata
- dehydrated
vars:
ssl_domains: "{{ [ inventory_hostname ] + [ airflow_public_fqdn ] }}"
recurse: true

- name: Setup airflow nginx config
ansible.builtin.template:
Expand Down

0 comments on commit 2556928

Please sign in to comment.