container: Allow custom ip addresses for more than one network

This commit is contained in:
uumas
2026-03-14 23:33:04 +02:00
parent ca29ffb271
commit f64ea2cbe3
14 changed files with 82 additions and 71 deletions

View File

@@ -13,14 +13,13 @@
ansible.builtin.include_role:
name: network
vars:
network_name: "{{ network }}"
network_subnet: "{{ _container_network_subnet if network_index == 0 else '' }}"
network_range: "{{ _container_network_range if network_index == 0 else '' }}"
when: network_created_networks is not defined or network not in network_created_networks
network_name: "{{ network.name }}"
network_subnet: "{{ _container_network_subnet }}"
network_range: "{{ _container_network_range }}"
when: network_created_networks is not defined or network.name not in network_created_networks
loop: "{{ container_networks }}"
loop_control:
loop_var: network
index_var: network_index
- name: Create volumes for container {{ container_name }}
ansible.builtin.include_role:
@@ -49,7 +48,7 @@
user: "{{ container_user or omit }}"
mount: "{{ _container_mounts | map('items') | map('map', 'join', '=') | map('join', ',') }}"
device: "{{ _container_devices }}"
network: "{{ _container_networks_with_ip }}"
network: "{{ _container_networks }}"
hostname: "{{ container_hostname or omit }}"
publish: "{{ container_publish_ports }}"
secrets: "{{ _container_secrets }}"