Skip to content

Host your own Ansible galaxy Server

Ansible Galaxy Server is the server/tool behind https://galaxy.ansible.com/
A tool for using and sharing Ansible Content with the community.

Repo: https://github.com/ansible/galaxy/

There is no official guide to install your own server in production but it is possible to follow
contributor guide to do it. it is easy!

Note

You can use ansible-galaxy features through the command ansible-galaxy without
intsalling the the GUI(Server).

If you installed the GUI you can also removed it without losing your data and features

Build & Install

Notes of an installation made a few years ago
    # Connect to the server.. it must have docker

    make dev/up_detached

    cd /tmp/
    git clone --branch stable/3.1 https://github.com/ansible/galaxy.git
    cd galaxy
    make dev/up_detached # you can also build image before with make dev/build
    ## In current case; make dev/up_detached  fails for various reasons.
    ### following actions has been done

    ## modif du Dockerfile, ajout de " || true"
    vim ./scripts/docker/dev/Dockerfile et vim ./scripts/docker/dev/entrypoint.sh

    make dev/build => 
        docker build --rm -t galaxy-dev -f scripts/docker/dev/Dockerfile .
    make dev/up_detached=>
        docker-compose -p galaxy -f ./scripts/docker/dev/compose.yml up -d
    make dev/down=> 
        docker-compose -p galaxy -f ./scripts/docker/dev/compose.yml down

    # Access: http://galaxy.example.com:8000

Post build setup

View
    make dev/createsuperuse=>
        DOCKER_COMPOSE= docker-compose -p galaxy -f ./scripts/docker/dev/compose.yml
        $(DOCKER_COMPOSE) exec galaxy $(GALAXY_VENV)/bin/python ./manage.py createsuperuser
    user: usergalaxy
    pwd: xxxx
    admin: http://galaxy.example.com:8000/admin
Various: customize release container
    make build/release
        container de galaxy-build

    docker cp  bb27278c8ee4:/galaxy/build/static .

    # Dans ./scripts/docker/release/Dockerfile et 1 dans ..Dockerfile.static
    COPY scripts/docker/release/dist/VERSION /var/lib/galaxy
        scripts/docker/release/dist/*.whl /tmp
        scripts/docker/release/static/ /var/lib/galaxy/public/static/

        docker-compose -p galaxy -f ./scripts/docker/release/compose.yml up

        bash /entrypoint.sh manage createsuperuser