Skip to content

Conversation

dvic
Copy link
Contributor

@dvic dvic commented Sep 15, 2025

No description provided.

@dvic dvic requested a review from konstruktoid as a code owner September 15, 2025 09:03
@dvic
Copy link
Contributor Author

dvic commented Sep 15, 2025

I noticed the changes from my PR #990 got reverted, was this intentional? In any case, those changes no longer worked, i got

ansible.posix was NOT installed successfully: - sorry, ansible.posix was not found on https://galaxy.ansible.com/api/.

This PR is the only thing that works, not sure what's going on. For reference:

❯ ansible-galaxy --version
ansible-galaxy [core 2.19.0]
  config file = /Users/dvic/Development/devops/ansible.cfg
  configured module search path = ['/Users/dvic/Development/devops/library']
  ansible python module location = /Users/dvic/Development/devops/.venv/lib/python3.13/site-packages/ansible
  ansible collection location = /Users/dvic/Development/devops/.ansible/collections
  executable location = /Users/dvic/Development/devops/.venv/bin/ansible-galaxy
  python version = 3.13.2 (main, Feb  5 2025, 18:58:04) [Clang 19.1.6 ] (/Users/dvic/Development/devops/.venv/bin/python3)
  jinja version = 3.1.6
  pyyaml version = 6.0.2 (with libyaml v0.2.5)

Any idea why this is not failing in CI?

@dvic
Copy link
Contributor Author

dvic commented Sep 15, 2025

Apparently it's not supported at all? ansible/ansible#76030

Maybe get rid of it and include in the readme explicitly the collection requirements?

@konstruktoid
Copy link
Owner

I noticed the changes from my PR #990 got reverted, was this intentional? In any case, those changes no longer worked, i got

no, not at all. I don't know why your PR wasn't successfully merged and the file updated.

@konstruktoid
Copy link
Owner

Any idea why this is not failing in CI?

in what situation should it break?

$ git log -n1 meta/requirements.yml
commit fbe78013e26b8d6c979b2eee0ed795a6d9f6279d (origin/require)
Author: Thomas Sjögren <[email protected]>
Date:   Fri Sep 12 14:00:24 2025 +0000

    update documentation and copy requirements.yml

    Signed-off-by: Thomas Sjögren <[email protected]>
$ ansible-galaxy install --force -r meta/requirements.yml
Starting galaxy collection install process
Process install dependency map
Cloning into '[...]/.ansible/tmp/ansible-local-2536592dm9thq46/tmpvmohif1n/ansible.posixj5vjxka0'...
remote: Enumerating objects: 4061, done.
remote: Counting objects: 100% (1287/1287), done.
remote: Compressing objects: 100% (331/331), done.
remote: Total 4061 (delta 1093), reused 960 (delta 956), pack-reused 2774 (from 4)
Receiving objects: 100% (4061/4061), 1.00 MiB | 2.92 MiB/s, done.
Resolving deltas: 100% (2385/2385), done.
HEAD is now at e54b8bf Merge pull request #658 from saito-hideki/release_2.1.0
Cloning into '[...]/.ansible/tmp/ansible-local-2536592dm9thq46/tmpvmohif1n/community.cryptoyb859u3v'...
remote: Enumerating objects: 22980, done.
remote: Counting objects: 100% (1151/1151), done.
remote: Compressing objects: 100% (579/579), done.
remote: Total 22980 (delta 872), reused 584 (delta 572), pack-reused 21829 (from 4)
Receiving objects: 100% (22980/22980), 29.05 MiB | 4.98 MiB/s, done.
Resolving deltas: 100% (16215/16215), done.
HEAD is now at 114c9892 Release 3.0.3.
Cloning into '[...]/.ansible/tmp/ansible-local-2536592dm9thq46/tmpvmohif1n/community.generalml05fty8'...
remote: Enumerating objects: 92353, done.
remote: Counting objects: 100% (63/63), done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 92353 (delta 29), reused 16 (delta 7), pack-reused 92290 (from 1)
Receiving objects: 100% (92353/92353), 36.02 MiB | 8.53 MiB/s, done.
Resolving deltas: 100% (63602/63602), done.
HEAD is now at f9b7938cf Release 11.3.0.
Starting collection install process
Installing 'ansible.posix:2.1.0' to '[...]/.ansible/collections/ansible_collections/ansible/posix'
Created collection for ansible.posix:2.1.0 at [...]/.ansible/collections/ansible_collections/ansible/posix
ansible.posix:2.1.0 was installed successfully
Installing 'community.crypto:3.0.3' to '[...]/.ansible/collections/ansible_collections/community/crypto'
Created collection for community.crypto:3.0.3 at [...]/.ansible/collections/ansible_collections/community/crypto
community.crypto:3.0.3 was installed successfully
Installing 'community.general:11.3.0' to '[...]/.ansible/collections/ansible_collections/community/general'
Created collection for community.general:11.3.0 at [...]/.ansible/collections/ansible_collections/community/general
community.general:11.3.0 was installed successfully
$ ansible --version
ansible [core 2.19.2]
  config file = None
  configured module search path = ['[...]/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = [...]/Code/venvs/base/lib/python3.13/site-packages/ansible
  ansible collection location = [...]/.ansible/collections:/usr/share/ansible/collections
  executable location = [...]/Code/venvs/base/bin/ansible
  python version = 3.13.5 (main, Jul 23 2025, 00:37:22) [Clang 20.1.4 ] ([...]/Code/venvs/base/bin/python3)
  jinja version = 3.1.6
  pyyaml version = 6.0.2 (with libyaml v0.2.5)

@dvic
Copy link
Contributor Author

dvic commented Sep 16, 2025

Any idea why this is not failing in CI?

in what situation should it break?

$ git log -n1 meta/requirements.yml
commit fbe78013e26b8d6c979b2eee0ed795a6d9f6279d (origin/require)
Author: Thomas Sjögren <[email protected]>
Date:   Fri Sep 12 14:00:24 2025 +0000

    update documentation and copy requirements.yml

    Signed-off-by: Thomas Sjögren <[email protected]>
$ ansible-galaxy install --force -r meta/requirements.yml
Starting galaxy collection install process
Process install dependency map
Cloning into '[...]/.ansible/tmp/ansible-local-2536592dm9thq46/tmpvmohif1n/ansible.posixj5vjxka0'...
remote: Enumerating objects: 4061, done.
remote: Counting objects: 100% (1287/1287), done.
remote: Compressing objects: 100% (331/331), done.
remote: Total 4061 (delta 1093), reused 960 (delta 956), pack-reused 2774 (from 4)
Receiving objects: 100% (4061/4061), 1.00 MiB | 2.92 MiB/s, done.
Resolving deltas: 100% (2385/2385), done.
HEAD is now at e54b8bf Merge pull request #658 from saito-hideki/release_2.1.0
Cloning into '[...]/.ansible/tmp/ansible-local-2536592dm9thq46/tmpvmohif1n/community.cryptoyb859u3v'...
remote: Enumerating objects: 22980, done.
remote: Counting objects: 100% (1151/1151), done.
remote: Compressing objects: 100% (579/579), done.
remote: Total 22980 (delta 872), reused 584 (delta 572), pack-reused 21829 (from 4)
Receiving objects: 100% (22980/22980), 29.05 MiB | 4.98 MiB/s, done.
Resolving deltas: 100% (16215/16215), done.
HEAD is now at 114c9892 Release 3.0.3.
Cloning into '[...]/.ansible/tmp/ansible-local-2536592dm9thq46/tmpvmohif1n/community.generalml05fty8'...
remote: Enumerating objects: 92353, done.
remote: Counting objects: 100% (63/63), done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 92353 (delta 29), reused 16 (delta 7), pack-reused 92290 (from 1)
Receiving objects: 100% (92353/92353), 36.02 MiB | 8.53 MiB/s, done.
Resolving deltas: 100% (63602/63602), done.
HEAD is now at f9b7938cf Release 11.3.0.
Starting collection install process
Installing 'ansible.posix:2.1.0' to '[...]/.ansible/collections/ansible_collections/ansible/posix'
Created collection for ansible.posix:2.1.0 at [...]/.ansible/collections/ansible_collections/ansible/posix
ansible.posix:2.1.0 was installed successfully
Installing 'community.crypto:3.0.3' to '[...]/.ansible/collections/ansible_collections/community/crypto'
Created collection for community.crypto:3.0.3 at [...]/.ansible/collections/ansible_collections/community/crypto
community.crypto:3.0.3 was installed successfully
Installing 'community.general:11.3.0' to '[...]/.ansible/collections/ansible_collections/community/general'
Created collection for community.general:11.3.0 at [...]/.ansible/collections/ansible_collections/community/general
community.general:11.3.0 was installed successfully
$ ansible --version
ansible [core 2.19.2]
  config file = None
  configured module search path = ['[...]/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = [...]/Code/venvs/base/lib/python3.13/site-packages/ansible
  ansible collection location = [...]/.ansible/collections:/usr/share/ansible/collections
  executable location = [...]/Code/venvs/base/bin/ansible
  python version = 3.13.5 (main, Jul 23 2025, 00:37:22) [Clang 20.1.4 ] ([...]/Code/venvs/base/bin/python3)
  jinja version = 3.1.6
  pyyaml version = 6.0.2 (with libyaml v0.2.5)

If you use your role in a requirements.yml like

collections: []
roles:
  - name: konstruktoid.hardening
    version: SHA_VERSION
    src: https://github.com/konstruktoid/ansible-role-hardening.git
    scm: git

(or probably also the published version)

and then run ansible-galaxy install -r requirements.yml --force

Then you get the error, either that the structure is incorrect (roles cannot have meta/requirement.yml with 'roles' or 'collections' key) or when we omit this, that the role cannot be found.

@dvic
Copy link
Contributor Author

dvic commented Sep 16, 2025

But what I've read online is that it is best to point users in the readme to explicitly add these dependencies on collections themselves. Ansible apparently doesn't support this.

@konstruktoid
Copy link
Owner

konstruktoid commented Sep 16, 2025

i vote for removing meta/requirements.yml all together, it seems to cause more trouble than benefits

@dvic
Copy link
Contributor Author

dvic commented Sep 17, 2025

i vore for removing meta/requirements.yml all together, it seems to cause more trouble than benefits

Agreed!

@konstruktoid
Copy link
Owner

update the PR and I'll merge it.
thanks again @dvic

Users should install required collections themselves rather than having
them auto-installed via meta dependencies. Updated README to provide
clear installation instructions for ansible.posix, community.crypto,
and community.general collections.
@dvic dvic changed the title Fix requirements.yml Remove meta/requirements.yml and document collection dependencies Sep 19, 2025
@dvic
Copy link
Contributor Author

dvic commented Sep 19, 2025

update the PR and I'll merge it. thanks again @dvic

done

@konstruktoid
Copy link
Owner

thanks!

@konstruktoid konstruktoid merged commit 2bbdd14 into konstruktoid:master Sep 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants