Community User Guide¶
If you are looking for v3 API reference please go to API v3
We have multiple instances of the beta site running to cover the dev, staging and production lifecycle.
The "dev" instance is auto-deployed from new commits to the master branch of https://github.com/ansible/galaxy_ng. Staging and Production deployments are triggered manually or via new tags on the git repository.
All instances are wired up for github social auth, so you can log into any of them with your github account.
Visit https://beta-galaxy.ansible.com/ in any modern web browser. Once the site loads, click on the "login" link at the top right of the page. On your first attempt, you'll be brought to a github authorization page. This is to be expected because github social auth is the default and only supported login mechanism in https://galaxy.ansible.com and for the future replacement. Once authorized, you should be redirected back to the main page and see your github username replace the word "login" at the top right of the page.
Generating an API token¶
The UI path for GalaxyNG to retrieve an api token differs from Galaxy. In the left hand nav menu, click on "Collections" > "Api token management". Click the blue "Load Token" button to reveal your API token.
Each time you click on "Load Token", it will invalidate the old token and make a new one. Be sure to save your token somewhere safe and secure and not rely on the token management page to keep track of it for you.
Ansible Core CLI setup¶
The ansible-galaxy cli is configured by default to talk to https://galaxy.ansible.com. To configure ansible core to talk to the beta galaxy_ng server, create an ansible.cfg file with the following content.
[galaxy] server_list = beta [galaxy_server.beta] url = https://beta-galaxy.ansible.com/api/ token = <your-api-token>
You only need a token set in the config if you plan on importing or uploading content. Anonymous read-only operations are fully supported.
Standalone roles are searchable via the UI, api or galaxy cli.
In the left nav menu, click on "Legacy" and then "Legacy Roles". Once the legacy roles page loads, a filter tool will be present at the top of the page. Search options are keywords or tags. Tags come from the role's metadata file and are defined the role author. Keywords are a full text search across the role's namespace, name and description.
The v1 rest api has filter parameter support similar to the current code on https://galaxy.ansible.com.
# Find all roles created by a specific github user. curl 'https://beta-galaxy.ansible.com/api/v1/roles/?github_user=geerlingguy' # Find all roles containing a keyword in the namespace, name or description. curl 'https://beta-galaxy.ansible.com/api/v1/roles/?keyword=docker'
The ansible-galaxy CLI also supports role search
ansible-galaxy role search --help
Collections do have search support in the UI.
- In the left-nav click "Collections".
- Choose keywords or tag.
- Type the term or select a tag to filter the list of results.
Future support for collection search in the ansible-galaxy CLI is TBD.
Role installs should work as they did before with https://galaxy.ansible.com
ansible-galaxy role install geerlingguy.docker
Collection installs should work as they did before with https://galaxy.ansible.com
ansible-galaxy collection install community.general
Role imports are only supported through the ansible galaxy cli. Once a valid ansible.cfg is setup, run the
ansible-galaxy role import command to import one of your roles hosted on https://github.com
Collections can be uploaded either by the ansible galaxy CLI or in the GalaxyNG web interface.
ansible-galaxy collection publish --help
- In the left-nav click on "Collections"
- Click on "Namespace"
- In the center page, click on the tab in the upper middle that says "My namespaces"
- Click "view collections" on one of the namespaces listed.
- If the collection has no previous versions, click on the blue "Upload Collection" button and follow the prompts.
- If the collection has previous versions, click the vertical 3 dot hamburger menu on the upper right and choose "upload new version" and then follow the prompts.