From 20c05bac21425c1ac347468207aa54c12ef11e62 Mon Sep 17 00:00:00 2001 From: "Philip (a-0)" <@ph:a-0.me> Date: Thu, 28 Jul 2022 22:15:29 +0200 Subject: [PATCH] moved iptables script to template --- roles/tor_gateway/tasks/main.yml | 10 +++++++--- .../{files/iptables.sh => templates/iptables.sh.j2} | 0 2 files changed, 7 insertions(+), 3 deletions(-) rename roles/tor_gateway/{files/iptables.sh => templates/iptables.sh.j2} (100%) diff --git a/roles/tor_gateway/tasks/main.yml b/roles/tor_gateway/tasks/main.yml index 9d5d8d6..8313f6d 100644 --- a/roles/tor_gateway/tasks/main.yml +++ b/roles/tor_gateway/tasks/main.yml @@ -13,10 +13,14 @@ name: iptables-persistent state: present -- name: set iptables rules +- name: Template & copy iptables script + template: + src: iptables.sh.j2 + dest: iptables.sh + +- name: Execute iptables script become: yes - script: iptables.sh - notify: persist iptables + shell: bash iptables.sh - name: set nameserver to localhost copy: diff --git a/roles/tor_gateway/files/iptables.sh b/roles/tor_gateway/templates/iptables.sh.j2 similarity index 100% rename from roles/tor_gateway/files/iptables.sh rename to roles/tor_gateway/templates/iptables.sh.j2