Hello, thank you to who will know to point what I’m doing wrong with the ah_configuration collection.
I just can’ delete a specific AAH hosted community.general collection with infra.ah_configuration.collection role.
When I run the playbook / role, it connects to the AAH server, and then it’s just like if the collection I want to delete (community.general 6.6.6, for the beauty of the example) does not already exist (no change, no error, just a ok status, whereas I know the given collection does exist, as it appears in the interface where I can download it from).
The server is an automation hub 4.7.3 (aap2.4.2.3 10/18). The collection version is 2.0.4.
Yaml file with credentials :
---
ah_host: https://aah.domain.org/
ah_username: admin
ah_password: *****
ah_validate_certs: false
Yaml file describing collection to delete :
---
ah_collections:
- namespace: community
name: general
version: 6.6.6
state: absent
Last, the playbook itself:
---
- name: Efface une collection
hosts: localhost
gather_facts: no
pre_tasks:
- name: include vars
ansible.builtin.include_vars:
dir: ./vars
extensions: ["yml"]
roles:
- infra.ah_configuration.collection
Playbook execution :
$ ansible-playbook collection_destroy.yml
PLAY [Efface une collection] ***************************************************************************************************************
TASK [include vars] ************************************************************************************************************************
ok: [localhost]
TASK [infra.ah_configuration.collection : Validating arguments against arg spec 'main' - An Ansible Role to update, or destroy Automation Hub Collections.] ***
ok: [localhost]
TASK [infra.ah_configuration.collection : Update or destroy Automation Hub Collection] *****************************************************
ok: [localhost] => (item={'namespace': 'community', 'name': 'general', 'version': '6.6.6', 'state': 'absent'})
TASK [infra.ah_configuration.collection : Sleep for 10 seconds and continue with play] *****************************************************
ok: [localhost]
TASK [infra.ah_configuration.collection : Update/Destroy collection | Wait for finish the update/destruction of collection] ****************
ok: [localhost] => (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': 'j875973451569.693423', 'results_file': '/root/.ansible_async/j875973451569.693423', 'changed': False, '__collection': {'namespace': 'community', 'name': 'general', 'version': '6.6.6', 'state': 'absent'}, 'ansible_loop_var': '__collection'})
PLAY RECAP *********************************************************************************************************************************
localhost : ok=5 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
I’m quite sure I do a stupid mistake somewhere or there’s a subtlety, but I just can not see what’s wrong.
thanks in advance, J