From 43f844014be8238d57e07fa325838a3877b5ab4c Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Mon, 20 Mar 2023 21:53:48 +0100 Subject: [PATCH] Add dynamic LXC groups - Distribution - Packet manager (from first line and word of python install command) --- create_inventory_lxc.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/create_inventory_lxc.yml b/create_inventory_lxc.yml index 3a1feca..26eb3ea 100644 --- a/create_inventory_lxc.yml +++ b/create_inventory_lxc.yml @@ -90,6 +90,9 @@ template: download template_options: "-a amd64 -d {{ os_d }} -r {{ os_r }} {% if 'no-validate' in lxc_download_validate.stdout %}--no-validate{% endif %}" config: "{{ lxc_config_file|default('/etc/lxc/ansible.conf') }}" + container_config: + - "lxc.group = {{ os_d }}" + - "lxc.group = {{ (cmdline_python[os_d][0]).split(' ')[0].split('-')[0] }}" register: lxc_created delegate_to: "{{ ansible_host|default('localhost') }}"