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

proxmox fails to remove non-existing container #9781

Open
1 task done
toxic0berliner opened this issue Feb 20, 2025 · 2 comments
Open
1 task done

proxmox fails to remove non-existing container #9781

toxic0berliner opened this issue Feb 20, 2025 · 2 comments
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)

Comments

@toxic0berliner
Copy link

Summary

seems to me there is an issue with idempotency here, this task

- name: Delete container
      connection: local
      vars: 
        ansible_python_interpreter: "auto_silent"
      community.general.proxmox:
        vmid: "{{ pveid }}"
        api_user: "{{ pveuser }}"
        api_token_id: "{{ pvetokenid }}"
        api_token_secret: "{{ pvetokensecret }}"
        api_host: "{{ pvehost }}"
        purge: true
        state: "absent"
      async: 60
      poll: 5

Fails with
fatal: [myCT]: FAILED! => {"ansible_job_id": "j448960346785.30435", "changed": false, "finished": 1, "msg": "could not find job", "results_file": "/home/semaphore/.ansible_async/j448960346785.30435", "started": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []} when running it in my semaphore instance
All other tasks work fine and thare is no issue when the CT exists...

I found the j44... file it talks about, here it is

{"changed": false, "vmid": 663, "msg": "VM 663 does not exist",
"invocation": {"module_args":
{"vmid": 663, "api_user": "XXXXXX@YYYYYYY", "api_token_id": "ansible",
"api_token_secret": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"api_host": "mpvehost", "purge": true,
"state": "absent", "validate_certs": false, "ostype": "auto", "storage": "local",
"timeout": 30, "update": false, "force": false,
"unprivileged": true, "proxmox_default_behavior": "no_defaults",
"clone_type": "opportunistic", "api_password": null, "node": null, "pool": null,
"password": null, "hostname": null, "ostemplate": null, "disk": null, "cores": null,
"cpus": null, "memory": null, "swap": null, "netif": null, "mounts": null, "ip_address": null,
"onboot": null, "features": null, "startup": null, "cpuunits": null, "nameserver": null,
"searchdomain": null, "pubkey": null, "description": null, "hookscript": null, "timezone": null, "clone": null, "tags": null}}}

Issue Type

Bug Report

Component Name

proxmox

Ansible Version

$ ansible --version
ansible [core 2.16.8]
  config file = /tmp/semaphore/ansible.cfg
  configured module search path = ['/home/semaphore/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/semaphore/apps/ansible/9.4.0/venv/lib/python3.11/site-packages/ansible
  ansible collection location = /home/semaphore/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/semaphore/apps/ansible/9.4.0/venv/bin/ansible
  python version = 3.11.9 (main, Apr 14 2024, 13:40:00) [GCC 13.2.1 20231014] (/opt/semaphore/apps/ansible/9.4.0/venv/bin/python3)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /opt/semaphore/apps/ansible/9.4.0/venv/lib/python3.11/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 8.5.0

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = /tmp/semaphore/ansible.cfg
DEFAULT_LOAD_CALLBACK_PLUGINS(/tmp/semaphore/ansible.cfg) = True
DEFAULT_STDOUT_CALLBACK(/tmp/semaphore/ansible.cfg) = yaml
HOST_KEY_CHECKING(/tmp/semaphore/ansible.cfg) = False

OS / Environment

semaphore running in docker on debian host

Steps to Reproduce

see above

Expected Results

it should return ok & not changed, the CT is absent aloready, ok it had nothing to do but still, should not fail

Actual Results

see above

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

  • plugins/modules/proxmox

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Feb 20, 2025
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 module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

2 participants