From 3c62fa4b6bca25820578416df68f3290a94850e7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:41:00 +0200 Subject: [PATCH] bitwarden --- playbooks/mailu_switch_to_second.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 883757a..3cbfd53 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -3,6 +3,7 @@ ignore_unreachable: false vars: + NEW_IP: 192.168.77.238 arch_name: docker_mailu2_data containers: - nginx-app-1 @@ -49,13 +50,23 @@ command: nvram get vts_rulelist when: inventory_hostname in groups['router'] register: ruleset - + + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ app_path }}" + - set_fact: + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ app_path }}" + + - name: Pause for 60 seconds ansible.builtin.pause: seconds: 60 - name: Set new ruleset - command: nvram set vts_rulelist="{{ ruleset.stdout | replace('192.168.77.106', '192.168.77.246') }}" + command: nvram set vts_rulelist="{{ app_path }}" when: inventory_hostname in groups['router'] - name: Nvram commit