From 9385ec8011b8af129eb3354f990695e67897943a Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 29 Nov 2022 17:27:05 +0100 Subject: [PATCH] Add option to disable lxc interface management This change adds a new role default option which will allow operators to omit the deployment of specific lxc bridge network config. This change is being implemented because, as an operator, I have a host setup specifically built for OpenStack which includes an interface config covering the lxc deployment. Currently when running a deployment the role will attempt to deploy a new interface file which at best conflicts with the host setup and at worst fails to run due to the interface being in a state unknown to OSA. The new config option `lxc_net_managed` is default **true** keeping the existing expectations, but when set to **false** the role will no longer deploy an interface file or attempt to bring up the interface using the distro tools. Signed-off-by: Kevin Carter Change-Id: Icdf4a1f5ff98dc1b86c6a87ea4e606b7c74e1aac --- defaults/main.yml | 3 +++ releasenotes/notes/lxc_net_managed-7a898d07c240b424.yaml | 8 ++++++++ tasks/main.yml | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 releasenotes/notes/lxc_net_managed-7a898d07c240b424.yaml diff --git a/defaults/main.yml b/defaults/main.yml index c979a353..d6102982 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -95,6 +95,9 @@ lxc_container_base_name: "{{ lxc_cache_map.distro }}-{{ lxc_cache_map.release }} # Set the default zfs root name lxc_container_zfs_root_name: "pool/lxc" +# Allow OSA to generate the LXC network configuration and manage the interface state. +lxc_net_managed: true + # lxc container net network lxc_net_bridge: lxcbr0 lxc_net_bridge_port: none diff --git a/releasenotes/notes/lxc_net_managed-7a898d07c240b424.yaml b/releasenotes/notes/lxc_net_managed-7a898d07c240b424.yaml new file mode 100644 index 00000000..cb415b77 --- /dev/null +++ b/releasenotes/notes/lxc_net_managed-7a898d07c240b424.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The lxc_hosts role now supports the ability to omit lxc network + interface deployment. The option `lxc_net_managed` is a Boolean + operator and defaults to **true**. When this option is set to + **false** the role will not deploy an interface file or attempt + to manage the state of the interface. diff --git a/tasks/main.yml b/tasks/main.yml index dc1a4eb6..64db2852 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -75,6 +75,8 @@ - lxc_hosts-config - include_tasks: lxc_net.yml + when: + - lxc_net_managed | bool tags: - lxc_hosts-config