aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/project/setup_jail.yaml
diff options
context:
space:
mode:
authorPanu Oksiala <panu@oksiala.fi>2024-01-22 00:24:37 +0200
committerPanu Oksiala <panu@oksiala.fi>2024-01-22 00:24:37 +0200
commit73c1115e6fba24b86eca1e5cad5f5086d6bd2ba6 (patch)
treedaedbc44f41c91a13cb7fc26edd325ab14996217 /ansible/project/setup_jail.yaml
Initial commit
Diffstat (limited to 'ansible/project/setup_jail.yaml')
-rw-r--r--ansible/project/setup_jail.yaml15
1 files changed, 15 insertions, 0 deletions
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 }}"