To login to Ansible Galaxy, you need a GitHub account. Ansible Galaxy internally uses the GitHub account to log in. You can pass your GitHub credentials to the below-given command.
$ ansible-galaxy role login
We need your GitHub login to identify you.
This information will not be sent to Galaxy, only to api.github.com.
The password will not be displayed.
Use --github-token if you do not want to enter your password.
GitHub Username: xxxxxx
Password for xxxxxx:
Successfully logged into Galaxy as xxxxxx