Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #5659/af53271c backport][stable-6] lxc_container: fix lxc argument when executing lxc command #5698

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Dec 17, 2022

This is a backport of PR #5659 as merged into main (af53271).

SUMMARY

lxc_container fails when executing the lxc command (e.g. when creating a new container) because PR #5358 broke the module argument parsing. The resulting argument dict contained only the module argument name and the argument flag but not the value. E.g.

- lxc_container:
    template: debian

would result in the lxc command:

  • lxc template --template (current result)
  • lxc --template debian (while this is the correct line)

Fixes: 6f88426 ("lxc_container: minor refactor (#5358)")
Fixes #5578

CC: @russoz

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lxc_container

ADDITIONAL INFORMATION

To reproduce the issue create a container which doesn't exist before:

  - name: Create a started container
    community.general.lxc_container:
      name: some
      state: started
      template: template
      template_options: --dist debian --release bullseye --arch amd64

will execute
/usr/bin/lxc-create --name some --quiet template --template backing_store --bdev -- --dist debian --release bullseye --arch amd64

correct would be
/usr/bin/lxc-create --name some --quiet --template template --bdev dir -- --dist debian --release bullseye --arch amd64

lxc_container fails when executing the lxc command (e.g. when creating
a new container) because PR#5358 broke the module argument
parsing. The resulting argument dict contained only the module argument name
and the argument flag but not the value. E.g.
```
- lxc_container:
    template: debian
```
would result in lxc command arguments `lxc template --template` instead of
`lxc --template debian`.

Fixes: 6f88426 ("lxc_container: minor refactor (#5358)")
Fixes #5578

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
(cherry picked from commit af53271)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug cloud module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Dec 17, 2022
@felixfontein felixfontein merged commit 58f74b9 into stable-6 Dec 17, 2022
@felixfontein felixfontein deleted the patchback/backports/stable-6/af53271c41f14c39696b1ac3f65b3163407ab18b/pr-5659 branch December 17, 2022 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug cloud module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants