-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
lxc_container: lxc-create commandline yields unknown option error #5578
Comments
Files identified in the description: If these files are incorrect, please update the |
Files identified in the description: If these files are incorrect, please update the |
hi @nblock thanks for reporting this! I have no experience with LXC, so I cannot easily pinpoint what the problem is. That being said, I am reading:
And based on that, it looks like this command line is syntactically correct: # /usr/bin/lxc-create --name mycontainer --quiet template --template backing_store --bdev -- --release bullseye It seems that one would be able to check the available template options by running: # /usr/bin/lxc-create --template backing_store -h Could you please run that and paste the results here? TIA |
Thx for looking into this!
There is no template
|
Also note that the Working example: |
Pending more investigation (probably writing some tests too), but given:
It seems that the command line has been built wrongly for a long time. It is not |
Hi, ok, it seems there was already ticket on this broken lxc_container. I updated my ansible stuff yesterday from some very old version to current, and this lxc_container went broken. |
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 (ansible-collections#5358)") Closes ansible-collections#5578 Signed-off-by: Alexander Couzens <[email protected]>
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 (ansible-collections#5358)") Fixes ansible-collections#5578 Signed-off-by: Alexander Couzens <[email protected]>
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 (ansible-collections#5358)") Fixes ansible-collections#5578 Signed-off-by: Alexander Couzens <[email protected]>
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 <[email protected]> Signed-off-by: Alexander Couzens <[email protected]>
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 <[email protected]> Signed-off-by: Alexander Couzens <[email protected]> (cherry picked from commit af53271)
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 <[email protected]> Signed-off-by: Alexander Couzens <[email protected]> (cherry picked from commit af53271)
…t when executing lxc command (#5697) lxc_container: fix lxc argument when executing lxc command (#5659) 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 <[email protected]> Signed-off-by: Alexander Couzens <[email protected]> (cherry picked from commit af53271) Co-authored-by: Alexander Couzens <[email protected]>
…t when executing lxc command (#5698) lxc_container: fix lxc argument when executing lxc command (#5659) 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 <[email protected]> Signed-off-by: Alexander Couzens <[email protected]> (cherry picked from commit af53271) Co-authored-by: Alexander Couzens <[email protected]>
Summary
The
lxc_container
module builds an invalid commandline forlxc-create
with Ansible 6.6.0; works as expected on Ansible 6.5.0.Issue Type
Bug Report
Component Name
lxc_container
Ansible Version
Community.general Version
Configuration
not relevant
OS / Environment
Steps to Reproduce
Expected Results
A running container. The above steps to reproduce work just fine in Ansible 6.5.0, so it seems to be a regression in 6.6.0.
Actual Results
TASK [lxc_container : Create a started container] ********************************************************************************************************************************************************************************************* fatal: [node]: FAILED! => {"changed": false, "command": "/usr/bin/lxc-create --name mycontainer --quiet template --template backing_store --bdev -- --release bullseye", "err": "/usr/bin/lxc-create: unrecognized option '--release'\nUsage: lxc-create --name=NAME --template=TEMPLATE [OPTION...] [-- template-options]\n\nlxc-create creates a container\n\nOptions :\n -n, --name=NAME NAME of the container\n -f, --config=CONFIG Initial configuration file\n -t, --template=TEMPLATE Template to use to setup container\n -B, --bdev=BDEV Backing store type to use\n --dir=DIR Place rootfs directory under DIR\n\n BDEV options for LVM (with -B/--bdev lvm):\n --lvname=LVNAME Use LVM lv name LVNAME\n (Default: container name)\n --vgname=VG Use LVM vg called VG\n (Default: lxc)\n --thinpool=TP Use LVM thin pool called TP\n (Default: lxc)\n\n BDEV options for Ceph RBD (with -B/--bdev rbd) :\n --rbdname=RBDNAME Use Ceph RBD name RBDNAME\n (Default: container name)\n --rbdpool=POOL Use Ceph RBD pool name POOL\n (Default: lxc)\n\n BDEV option for ZFS (with -B/--bdev zfs) :\n --zfsroot=PATH Create zfs under given zfsroot\n (Default: tank/lxc)\n\n BDEV options for LVM or Loop (with -B/--bdev lvm/loop) :\n --fstype=TYPE Create fstype TYPE\n (Default: ext4)\n --fssize=SIZE[U] Create filesystem of\n size SIZE * unit U (bBkKmMgGtT)\n (Default: 1G, default unit: M)\n -- template-options\n This will pass template-options to the template as arguments.\n To see the list of options supported by the template,\n you can run lxc-create -t TEMPLATE -h.\n\nCommon options :\n -o, --logfile=FILE Output log to FILE instead of stderr\n -l, --logpriority=LEVEL Set log priority to LEVEL\n -q, --quiet Don't produce any output\n -P, --lxcpath=PATH Use specified container path\n -?, --help Give this help list\n --usage Give a short usage message\n --version Print the version number\n\nMandatory or optional arguments to long options are also mandatory or optional\nfor any corresponding short options.\n\nSee the lxc-create man page for further information.\n\n", "msg": "Failed executing lxc-create.", "rc": 1}
Running the created commandline in the shell for some nicer output:
Code of Conduct
The text was updated successfully, but these errors were encountered: