Open moqmar opened 2 years ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @cloudnull click here for bot help
I think this is a mistake, since the comment above it explicitly says # If the sanitized values don't match replace them
.
Something really important I just noticed about that: there are some LXC options which can be specified multiple times! An example would be lxc.cgroup2.devices.allow
.
Maybe we can use :=
to overwrite existing options? Or the more Ansible-like way of having different maps container_config_append
(with the old container_config
as an alias and everything just as it works right now), container_config_overwrite
and container_config_remove
(or _present
, _overwrite
and _absent
)? The most verbose alternative would be to have a separate lxc_container_config
module that can then use state: present|absent
and overwrite: true
.
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
Summary
When changing a value in
container_config
, a line gets added instead of replaced in/var/lib/lxc/CONTAINER/config
.It seems to affect line lxc_container.py:723 - I don't really understand why it's using
container_config.insert
there instead of just settingcontainer_config[line_index]
Issue Type
Bug Report
Component Name
lxc_container
Ansible Version
Community.general Version
Configuration
No response
OS / Environment
Debian 11 Bullseye
Steps to Reproduce
Expected Results
I'd expect the line to be replaced:
Actual Results
The line gets added:
This by itself accidentally "works", as LXC will take the latter value, but if I change it back to the first value, nothing will happen and it will forever stay at the second value.
Code of Conduct