Skip to content
Snippets Groups Projects
Commit 7ad617a3 authored by Baptiste DE RENZO's avatar Baptiste DE RENZO
Browse files

Merge branch 't37651-disable-masquerade-bridge-when-host-bridge' into 'main'

Disable masquerade bridge when host bridge configured, Fix #37651

See merge request sys/ansible-public!43
parents 80f886ef a75babb0
No related branches found
No related tags found
No related merge requests found
USE_LXC_BRIDGE="false"
---
- name: Masquerade bridge configuration
- name: LXC packages installation
ansible.builtin.apt:
force_apt_get: true
name:
- lxc
- lxcfs
- bridge-utils
state: present
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
- name: Host bridge configuration
when: lxc_network_type == 'host_bridge'
block:
- name: Masquerade bridge configuration disabling
notify: restart lxc-net
ansible.builtin.copy:
src: lxc-net.host_bridge
dest: /etc/default/lxc-net
mode: "644"
- name: Ask confirmation
ansible.builtin.pause:
prompt: |
......@@ -12,7 +31,6 @@
Documentation (section host device as bridge): https://wiki.debian.org/LXC/SimpleBridge
Continue (yes/no)
-------------------------------------------------------------------------------------------
when: lxc_network_type == 'host_bridge'
register: confirm_continue
no_log: true
......@@ -21,33 +39,21 @@
msg: 'Installation aborted'
when: not ((confirm_continue.user_input | bool) or (confirm_continue.user_input | length == 0))
- name: LXC packages installation
ansible.builtin.apt:
force_apt_get: true
name:
- lxc
- lxcfs
- bridge-utils
state: present
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
- name: Default container configuration
notify: restart lxc
ansible.builtin.template:
src: lxc-default.j2
dest: /etc/lxc/default.conf
mode: "644"
- name: Masquerade bridge configuration
when: lxc_network_type == 'masquerade_bridge'
block:
- name: Container network configuration
notify: restart lxc-net
ansible.builtin.template:
src: lxc-net.j2
ansible.builtin.copy:
src: lxc-net.masquerade_bridge
dest: /etc/default/lxc-net
mode: "644"
- name: Default container configuration
notify: restart lxc
ansible.builtin.template:
src: lxc-default.j2
dest: /etc/lxc/default.conf
mode: "644"
...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment