Hello there!
I have been experimenting with making a container with Ansible in WSL.
I am experiencing problems with an unclear (to me) error message.
Current message is “not found”.
I tried creating a container with the example code in the module examples using:
- name: Create a started container
community.general.lxd_container:
name: mycontainer
url: "unix:/var/lib/incus/unix.socket"
ignore_volatile_options: true
state: started
source:
type: image
mode: pull
# Provides Ubuntu minimal images
server: https://cloud-images.ubuntu.com/minimal/releases/
protocol: simplestreams
alias: "22.04"
profiles: ["default"]
wait_for_ipv4_addresses: true
timeout: 600
connection: local
delegate_to: localhost
with some extra info in the error message being:
The full traceback is:
File "/tmp/ansible_community.general.lxd_container_payload_p34j783m/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py", line 744, in run
action()
File "/tmp/ansible_community.general.lxd_container_payload_p34j783m/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py", line 612, in _started
self._create_instance()
File "/tmp/ansible_community.general.lxd_container_payload_p34j783m/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py", line 555, in _create_instance
self.client.do('POST', url, config, wait_for_container=self.wait_for_container)
File "/tmp/ansible_community.general.lxd_container_payload_p34j783m/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/module_utils/lxd.py", line 81, in do
resp_json = self._send_request(method, url, body_json=body_json, ok_error_codes=ok_error_codes, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/ansible_community.general.lxd_container_payload_p34j783m/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/module_utils/lxd.py", line 115, in _send_request
self._raise_err_from_json(resp_json)
File "/tmp/ansible_community.general.lxd_container_payload_p34j783m/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/module_utils/lxd.py", line 124, in _raise_err_from_json
raise LXDClientException(self._get_err_from_resp_json(resp_json), **err_params)
fatal: [localhost]: FAILED! => changed=false
actions: []
diff:
after:
instance:
profiles:
- default
source:
alias: '22.04'
mode: pull
protocol: simplestreams
server: https://cloud-images.ubuntu.com/minimal/releases/
type: image
state: started
before:
instance: {}
state: absent
invocation:
module_args:
architecture: null
client_cert: null
client_key: null
config: null
devices: null
ephemeral: null
force_stop: false
ignore_volatile_options: true
name: mycontainer
profiles:
- default
project: null
snap_url: unix:/var/snap/lxd/common/lxd/unix.socket
source:
alias: '22.04'
mode: pull
protocol: simplestreams
server: https://cloud-images.ubuntu.com/minimal/releases/
type: image
state: started
target: null
timeout: 600
trust_password: null
type: container
url: unix:/var/lib/incus/unix.socket
wait_for_container: false
wait_for_ipv4_addresses: true
msg: not found
Any direction anyone could point me in? Thanks in advance!
Kind regards