ansible / galaxy_collection

Collection of modules and roles to configure Automation Hub
GNU General Public License v3.0
54 stars 50 forks source link

Unable to remove requirements.yml from a remote. #413

Open djdanielsson opened 1 week ago

djdanielsson commented 1 week ago

Discussed in https://github.com/ansible/galaxy_collection/discussions/412

Originally posted by @smatterchew June 26, 2024 Hello. I am trying to remove a `requirements.yml` from a remote in Private Automation Hub v4.9.1 using `infra.ah_configuration.collection_remote`. I've tried setting the `requirements: []` to an empty list and the task succeeded, but the remote still had a collection list. Then I tried to set `requirements_file: empty_requirements_file.yml` and the empty file wasn't found in the files directory off the root of the role directory. I also tried to specify the path to the file as `requirements_file: ./files/empty_requirements_file.yml` and that also failed. 1. How come the first process of defining an empty list did not remove the requirements file? It didn't even end up as an empty list. The existing collection was still there. 2. Where in the role can I store the empty requirements file so the task module can find it? I don't want to host it on the execution node outside the Execution Environment. 3. Can we just provide a state (default: present) switch for the requirements file to have the module delete the requirements file? Thank you in advance for your help.