Skip to content

Commit

Permalink
Uses distribution based variables in app handlers
Browse files Browse the repository at this point in the history
Based on PR review feedback, we are now using paths defined in the
variable vars files (based on the Ubuntu distribution value).
  • Loading branch information
kushaldas authored and Conor Schaefer committed Feb 10, 2021
1 parent 5ed8bc3 commit 27ccd22
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
9 changes: 1 addition & 8 deletions install_files/ansible-base/roles/app/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
state: restarted

- name: reload iptables rules for xenial
shell: iptables-restore < /etc/network/iptables/rules_v4
when:
- ansible_distribution_release == 'xenial'

- name: reload iptables rules for focal
shell: iptables-restore < /etc/iptables/rules.v4
when:
- ansible_distribution_release == 'focal'
shell: iptables-restore < "{{ iptables_v4_path }}"

## App/securedrop section
- name: restart apache2
Expand Down
2 changes: 2 additions & 0 deletions install_files/ansible-base/roles/app/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
- include_vars: "{{ ansible_distribution }}_{{ ansible_distribution_release }}.yml"

- include: app_install_fpf_deb_pkgs.yml
when: securedrop_app_install_from_repo

Expand Down
3 changes: 3 additions & 0 deletions install_files/ansible-base/roles/app/vars/Ubuntu_focal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

iptables_v4_path: /etc/iptables/rules.v4
3 changes: 3 additions & 0 deletions install_files/ansible-base/roles/app/vars/Ubuntu_xenial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

iptables_v4_path: /etc/network/iptables/rules_v4

0 comments on commit 27ccd22

Please sign in to comment.