Logging in

It is possible to log in to Ansible Galaxy from the command line; you can do this by using the following:

$ ansible-galaxy login

This will ask for your GitHub username and password; if you have two-factor authentication enabled on your GitHub account, which you really should do, then this method will not work. Instead, you will need to provide a personal access token. You can generate a personal access token at the following URL: https://github.com/settings/tokens/. Once you have a token, you can use the following command, replacing the token with your own:

$ ansible-galaxy login --github-token 0aa7c253044609b98425865wbf6z679a94613bae89

The following screenshot shows the output for the preceding command:

Personal access tokens ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.