From 73c1115e6fba24b86eca1e5cad5f5086d6bd2ba6 Mon Sep 17 00:00:00 2001 From: Panu Oksiala Date: Mon, 22 Jan 2024 00:24:37 +0200 Subject: Initial commit --- ansible/project/setup_jail.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ansible/project/setup_jail.yaml (limited to 'ansible/project/setup_jail.yaml') diff --git a/ansible/project/setup_jail.yaml b/ansible/project/setup_jail.yaml new file mode 100644 index 0000000..58a3c99 --- /dev/null +++ b/ansible/project/setup_jail.yaml @@ -0,0 +1,15 @@ +- hosts: bsd_servers + tasks: + - name: setup jail + become: true + when: inventory_hostname == jail_host + block: + - name: install packages inside jail + community.general.pkgng: + name: "{{ jail_packages }}" + state: present + jail: "{{ jail_name }}" + + - name: run commands inside jail + ansible.builtin.shell: "jexec -u root {{ jail_name }} {{ item }}" + with_items: "{{ jail_commands }}" -- cgit v1.3