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

gitlab_runner deletion via state: absent doesn't work properly #7716

Closed
1 task done
jivuvtramvae opened this issue Dec 11, 2023 · 4 comments
Closed
1 task done

gitlab_runner deletion via state: absent doesn't work properly #7716

jivuvtramvae opened this issue Dec 11, 2023 · 4 comments
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)

Comments

@jivuvtramvae
Copy link

Summary

Unable to delete a gitlab runner when I have 20+ runners and the desired one is not listed in on the first page (API request for runners uses pagination).

Issue Type

Bug Report

Component Name

gitlab_runner

Ansible Version

$ ansible --version
ansible [core 2.12.10]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True

$ pip list
Package                    Version  
-------------------------- ---------
ansible                    5.5.0    
ansible-core               2.12.10  

Community.general Version

$ ansible-galaxy collection list community.general

# /usr/local/lib/python3.8/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 4.6.0  
# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 6.3.0 

Configuration

$ ansible-config dump --only-changed

Empty.

OS / Environment

Ubuntu 20.04.5 LTS

Steps to Reproduce

  1. Make sure you have 20+ runners and your desired one is not listed on the first page on paginated request curl --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" "https://gitlab.example.con/api/v4/runners" | jq '.[].id ' | sort
  - name: Try and remove this non-listed runner
    gitlab_runner:
      api_token: "{{ access_token }}"
      api_url: "{{ gitlab_url }}"
      description: "{{ ansible_hostname }}"
      state: absent

Expected Results

Runner getting deleted.

Actual Results

ok: [srv01-runner35] => {"changed": false, "msg": "Runner deleted or does not exists"}

(Spoiler: it actually exists on the second page of the gitlab API paginated request.)

Code of Conduct

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

Files identified in the description:

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 ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Dec 11, 2023
@felixfontein
Copy link
Collaborator

Seems to be a duplicate of #7690.

@lgatellier
Copy link
Contributor

IMHO it's actually a duplicate of #7690. I close this issue as the bug has been fixed by #7790.

Feel free to add some more comments it the bug is still present. :)

duplicate_of 7690

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

4 participants