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

Disable masquerade bridge when host bridge configured, Fix #37651

parent 80f886ef
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' when: lxc_network_type == 'host_bridge'
block: 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 - name: Ask confirmation
ansible.builtin.pause: ansible.builtin.pause:
prompt: | prompt: |
...@@ -12,7 +31,6 @@ ...@@ -12,7 +31,6 @@
Documentation (section host device as bridge): https://wiki.debian.org/LXC/SimpleBridge Documentation (section host device as bridge): https://wiki.debian.org/LXC/SimpleBridge
Continue (yes/no) Continue (yes/no)
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
when: lxc_network_type == 'host_bridge'
register: confirm_continue register: confirm_continue
no_log: true no_log: true
...@@ -21,33 +39,21 @@ ...@@ -21,33 +39,21 @@
msg: 'Installation aborted' msg: 'Installation aborted'
when: not ((confirm_continue.user_input | bool) or (confirm_continue.user_input | length == 0)) 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 - name: Masquerade bridge configuration
when: lxc_network_type == 'masquerade_bridge' when: lxc_network_type == 'masquerade_bridge'
block: block:
- name: Container network configuration - name: Container network configuration
notify: restart lxc-net notify: restart lxc-net
ansible.builtin.template: ansible.builtin.copy:
src: lxc-net.j2 src: lxc-net.masquerade_bridge
dest: /etc/default/lxc-net dest: /etc/default/lxc-net
mode: "644" 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