openstack ansible lxc containers
Using the lxc-container-create playbook, how to. create a container with a specific name and specific release ? openstack-ansible lxc-containers-create.yml -e "container_name=testing" -e "lxc_container_distribution=ubuntu" -e "lxc_container_release=jammy" --limit 'test' is throwing an error. it is trying to attach to the 'testing' container when it does not exist in the first place. I want the playbook to create one with that name ? So, what's the workaround ? --- module_stderr": "lxc-attach: testing: attach.c: get_attach_context: 405 Connection refused - Failed to get init pid\nlxc-attach: testing: attach.c: lxc_attach: 1469 Connection refused - Failed to get attach context\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", ----
Frankly, I never tried to do so. Eventually this role is quite "tied" together with our dynamic_inventory script and is a little bit opinionated. So if you want to create extra containers with the role, I'd suggest to define a custom group through env.d and then define on which hosts you want container to spawn by adding it to openstack_user_config. You can check on example how we adding an extra rabbitmq containers to the deployment for Trove here: https://docs.openstack.org/openstack-ansible-os_trove/latest/configure-trove... Or with k8s containers for Cluster API here: https://docs.openstack.org/openstack-ansible-ops/latest/mcapi.html#openstack... As you can see - adding extra containers through deployment is quite a trivial task. However, I'm not sure there's support for arbitrary versions at the moment, as role assumes container to be the same OS as the host it's running on right now. пн, 10 мар. 2025 г. в 16:24, engineer2024 <engineerlinux2024@gmail.com>:
Using the lxc-container-create playbook, how to. create a container with a specific name and specific release ?
openstack-ansible lxc-containers-create.yml -e "container_name=testing" -e "lxc_container_distribution=ubuntu" -e "lxc_container_release=jammy" --limit 'test'
is throwing an error. it is trying to attach to the 'testing' container when it does not exist in the first place. I want the playbook to create one with that name ? So, what's the workaround ?
--- module_stderr": "lxc-attach: testing: attach.c: get_attach_context: 405 Connection refused - Failed to get init pid\nlxc-attach: testing: attach.c: lxc_attach: 1469 Connection refused - Failed to get attach context\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", ----
participants (2)
-
Dmitriy Rabotyagov
-
engineer2024