From c89c678ea000505815d999bf0e7e0bc03bdddb0a Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 3 Sep 2022 02:04:28 +1200 Subject: [PATCH] add vault --- ansible/inventory/host_vars/lab.yaml | 1 + ansible/roles/firewall/defaults/main.yml | 2 ++ ansible/roles/firewall/tasks/main.yml | 10 ++++++++++ 3 files changed, 13 insertions(+) create mode 100644 ansible/roles/firewall/defaults/main.yml create mode 100644 ansible/roles/firewall/tasks/main.yml diff --git a/ansible/inventory/host_vars/lab.yaml b/ansible/inventory/host_vars/lab.yaml index 8cb132e..e501342 100644 --- a/ansible/inventory/host_vars/lab.yaml +++ b/ansible/inventory/host_vars/lab.yaml @@ -4,6 +4,7 @@ ansible_user: ladmin ansible_become_user: root +ansible_become_pass: "{{ lab_become_password }}" ansible_os_family: Arch # sshd diff --git a/ansible/roles/firewall/defaults/main.yml b/ansible/roles/firewall/defaults/main.yml new file mode 100644 index 0000000..325619a --- /dev/null +++ b/ansible/roles/firewall/defaults/main.yml @@ -0,0 +1,2 @@ +--- +firewall_package: ufw \ No newline at end of file diff --git a/ansible/roles/firewall/tasks/main.yml b/ansible/roles/firewall/tasks/main.yml new file mode 100644 index 0000000..053b899 --- /dev/null +++ b/ansible/roles/firewall/tasks/main.yml @@ -0,0 +1,10 @@ +--- +- name: install ufw arch + become: true + community.general.pacman: + name: "{{ firewall_package }}" + state: latest + update_cache: true + reason: explicit + when: + - ansible_os_family == 'Arch' \ No newline at end of file