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

[feat]: Ability to publish to Automation Hub or alternate galaxies #300

Open
ahuffman opened this issue Jun 30, 2022 · 5 comments
Open

[feat]: Ability to publish to Automation Hub or alternate galaxies #300

ahuffman opened this issue Jun 30, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@ahuffman
Copy link

image
Looks like the above image.

@ahuffman
Copy link
Author

I don't have all the details yet, but I think you can get a token like you can on Galaxy, but it may require user/pass options.

@artis3n
Copy link
Owner

artis3n commented Jun 30, 2022

Thanks for filing! I'll take a look, but yeah any details you can provide on how RedHat works here would be useful.

@artis3n artis3n added the enhancement New feature or request label Jun 30, 2022
@artis3n artis3n changed the title Ability to publish to Automation Hub or alternate galaxies [feat]: Ability to publish to Automation Hub or alternate galaxies Jun 30, 2022
@ahuffman
Copy link
Author

I got an example of what this looks like finally. Essentially you get a separate url to push to, an auth url, and a separate token. So if you provide those as add'l config params that would be all that's needed.

      - name: Upload to Ansible Automation Hub
        run: |
          cat << EOF > ansible.cfg
          [galaxy]
          server_list = automation_hub
          [galaxy_server.automation_hub]
          url=https://console.redhat.com/api/automation-hub/content/inbound-mycompany/
          auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
          token=$AAP_KEY
          EOF
          ansible-galaxy collection publish ./mycollection*.tar.gz

@artis3n artis3n self-assigned this Sep 13, 2022
@artis3n
Copy link
Owner

artis3n commented Sep 14, 2022

Token is already handled by the api_key input parameter so the need is to provide an optional path to set the --server API_SERVER parameter for ansible-galaxy. ansible-galaxy collection publish does not extend an auth_url flag so that looks Redhat-specific, need to understand how to best set that.

https://access.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/2.1/html/getting_started_with_automation_hub/proc-configure-automation-hub-server suggests auth_url is optional, depending on the automation hub server in question. So that should be supported but is not required for all automation hub targets.

@ahuffman I'm not familiar with navigating around RedHat's docs - is there an environment variable we can substitute for the auth_url ansible.cfg value? https://docs.ansible.com/ansible/latest/reference_appendices/config.html describes env var alternatives for default ansible.cfg values but auth_url isn't in there so not sure if an env var version exists. That would be my preferred way of implementing this support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants