Skip to content

Getting Data

Martin Hradil edited this page Dec 12, 2023 · 12 revisions

Collections

can be uploaded through Collections > Namespaces > tab My namespaces > detail > Upload Collection, once a namespace of the appropriate name exists (namespace-collection-version.tar.gz)

(can be downloaded from https://galaxy.ansible.com/)

cli upload

To generate & upload a new collection: galaxykit collection upload

To upload an existing tarball:

UPLOAD_URL=http://localhost:8002/api/automation-hub/v3/plugin/ansible/content/staging/collections/artifacts/
FILENAME="foo-bar-1.2.3.tar.gz"

curl -X POST "$UPLOAD_URL" -u admin:admin -F file=@"$FILENAME"

collection sync

edit community remote, use this for requirements.yml:

collections:
- name: community.general

then sync the community repository

Namespaces

can be created manually - Collections > Namespaces > Create

Repositories

(both local and remote repositories are a fixed list now)

Repositories and Remotes can be created in the UI

follow https://console.redhat.com/ansible/automation-hub/token to configure a remote to sync

Approval

TODO import a collection, and change a setting?

Containers / Execution Environments

local

docker login localhost:5001
for foo in  postgres mongo redis node  ; do
  docker pull $foo
  docker image tag $foo localhost:5001/$foo:latest
  docker push localhost:5001/$foo:latest
done

remote

can be added manually - Execution Environments > Execution Environments > Add remote repository, once a registry exists

Controllers

Needs a change in galaxy_ng/galaxy_ng/app/settings.py to see any controllers:

diff --git a/galaxy_ng/app/settings.py b/galaxy_ng/app/settings.py
index 7a84dfb..beeecac 100644
--- a/galaxy_ng/app/settings.py
+++ b/galaxy_ng/app/settings.py
@@ -314,1 +314,1 @@
-CONNECTED_ANSIBLE_CONTROLLERS = []
+CONNECTED_ANSIBLE_CONTROLLERS = ['https://example.com']

or the same in a PULP_CONNECTED_ANSIBLE_CONTROLLERS env variable, works in .compose.env

Remote Registries

can be added manually - Execution Environments > Remote Registries > Add remote registry

registry url: https://registry.hub.docker.com (any name; no username/password)

(Then add a remote EE: remote upstream_name: library/alpine (_/alpine on dockerhub becomes library/alpine) include tags: latest (otherwise it will fail trying to download too many images) )

Tasks

just import a container or collection, or sync

Users / Groups / Roles

can be created manually

Legacy Roles / Namespaces

curl \
    -u admin:admin \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{"github_user": "geerlingguy", "role_name": "docker"}' \
    http://localhost:5001/api/v1/sync/

regenerate tag counts: oci-env pulpcore-manager populate-role-tags

marks

CollectionVersionMark https://github.com/pulp/pulp_ansible/pull/1326