blob: 58a3c991d6a862870e7d9032a63de7e15f034c13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 }}"
|