Brian Bouterse
Senior Principal Software Engineer
Setting up an On-Premise Galaxy
Syncing in collections/roles from galaxy.ansible.com
Installing collections/roles using CLI
Uploading collections via ansible CLI
Organizing content in repositories
podman pull pulp/pulp-galaxy-ng
mkdir galaxy_ng
cd galaxy_ng
mkdir settings pulp_storage pgsql containers
echo "CONTENT_ORIGIN='http://$(hostname):8080'
ANSIBLE_API_HOSTNAME='http://$(hostname):8080'
ANSIBLE_CONTENT_HOSTNAME='http://$(hostname):8080/pulp/content'" >> settings/settings.py
podman
or docker
commandspodman run --detach \
--publish 8080:80 \
--name galaxy_ng \
--volume ./settings:/etc/pulp:Z \
--volume ./pulp_storage:/var/lib/pulp:Z \
--volume ./pgsql:/var/lib/pgsql:Z \
--volume ./containers:/var/lib/containers:Z \
--device /dev/fuse \
pulp/pulp-galaxy-ng
podman run --detach \
--publish 8080:80 \
--name galaxy_ng \
--volume ./settings:/etc/pulp \
--volume ./pulp_storage:/var/lib/pulp \
--volume ./pgsql:/var/lib/pgsql \
--volume ./containers:/var/lib/containers \
--device /dev/fuse \
pulp/pulp-galaxy-ng
DATA_FIXTURE_URL="https://raw.githubusercontent.com/ansible/galaxy_ng/master/dev/automation-hub/initial_data.json"
curl $DATA_FIXTURE_URL | podman exec -i galaxy_ng bash -c "cat > /tmp/initial_data.json"
podman exec galaxy_ng bash -c "/usr/local/bin/pulpcore-manager loaddata /tmp/initial_data.json"
podman exec -it galaxy_ng bash -c 'pulpcore-manager reset-admin-password'
Accessing the UI: http://localhost:8080
Showing the logs: podman logs -f galaxy_ng
---
collections:
# With just the collection name
- pulp.pulp_installer
- ansible.posix
---
collections:
# With just the collection name
- amazon.aws
ansible-galaxy collection install -p ./ pulp.pulp_installer
Add this to settings.py
:
galaxy_require_content_approval=False
https://github.com/ansible/galaxy_ng/wiki/Enabling-auto-certification
ansible-galaxy collection publish
commandpodman pull pulp/pulp
mkdir pulp
cd pulp
mkdir settings pulp_storage pgsql containers
echo "CONTENT_ORIGIN='http://$(hostname):8080'
ANSIBLE_API_HOSTNAME='http://$(hostname):8080'
ANSIBLE_CONTENT_HOSTNAME='http://$(hostname):8080/pulp/content'
TOKEN_AUTH_DISABLED=True" >> settings/settings.py
podman
or docker
commandspodman run --detach \
--publish 8080:80 \
--name pulp \
--volume ./settings:/etc/pulp:Z \
--volume ./pulp_storage:/var/lib/pulp:Z \
--volume ./pgsql:/var/lib/pgsql:Z \
--volume ./containers:/var/lib/containers:Z \
--device /dev/fuse \
pulp/pulp
podman run --detach \
--publish 8080:80 \
--name pulp \
--volume ./settings:/etc/pulp \
--volume ./pulp_storage:/var/lib/pulp \
--volume ./pgsql:/var/lib/pgsql \
--volume ./containers:/var/lib/containers \
--device /dev/fuse \
pulp/pulp
podman exec -it pulp bash -c 'pulpcore-manager reset-admin-password'
pulp config create
pulp config edit
Showing the logs: podman logs -f pulp
Status check: pulp status
API Documentation: http://localhost:8080/pulp/api/v3/docs/
pulp ansible repository create --name myrepo
pulp ansible repository list
pulp ansible remote -t collection create --name basic --url https://galaxy.ansible.com --requirements-file ~/Documents/Presentations/container_demo/basic.yml
pulp ansible remote list
pulp ansible distribution create --name mydistro --base-path foo --repository myrepo
pulp ansible distribution list
http://localhost.localdomain:8080/pulp_ansible/galaxy/foo/api/v3/collections/
pulp ansible repository sync --name myrepo --remote basic
pulp ansible distribution list
ansible-galaxy collection install -s http://localhost.localdomain:8080/pulp_ansible/galaxy/foo/ -p ./ pulp.pulp_installer
pulp ansible distribution list
https://galaxy.ansible.com/newswangerd/collection_demo
ansible-galaxy collection publish -s http://localhost.localdomain:8080/pulp_ansible/galaxy/foo/ newswangerd-collection_demo-1.0.10.tar.gz
http://localhost.localdomain:8080/pulp_ansible/galaxy/foo/api/v3/collections/
pulp ansible remote -t role create --name someroles --url https://galaxy.ansible.com/api/v1/roles/?namespace__name=elastic
pulp ansible repository sync --name myrepo --remote someroles
Viewing them: http://localhost.localdomain:8080/pulp_ansible/galaxy/foo/api/v1/roles/
pulp ansible distribution list
ansible-galaxy role install -s http://localhost.localdomain:8080/pulp_ansible/galaxy/foo/ -p ./ elasticsearch,6.2.4
Use an ansible.cfg like:
[galaxy]
server: http://localhost.localdomain:8080/pulp_ansible/galaxy/foo/
Then ansible-galaxy role install -p ./ elasticsearch,6.2.4
Not demo-ing but see these docs: https://docs.pulpproject.org/pulp_ansible/workflows/copy.html
Brian Bouterse
bmbouter@redhat.com