Skip to content

Commit

Permalink
update instructions of AH token
Browse files Browse the repository at this point in the history
  • Loading branch information
youtous committed Dec 2, 2023
1 parent 8b97b82 commit ab5d87d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 17 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ This document aims to outline the requirements for the various forms of contribu
3) Include a README.md in the subdirectory
## Testing
To run `ansible-lint` you will need to set an environment variable for the token to connect to Automation Hub. You can get a token from [here](https://console.redhat.com/ansible/automation-hub/token).
Copy the value of the token and run `export ANSIBLE_GALAXY_SERVER_AH_TOKEN=<token>`
We utilize pre-commit to handle Git hooks, initiating a pre-commit check with each commit, both locally and on CI.
To install pre-commit, use the following commands:
```bash
pip install pre-commit
pre-commit install
```

For further details, refer to the [pre-commit installation documentation](https://pre-commit.com/#installation).

To execute ansible-lint (whether within pre-commit or independently), you must configure an environment variable for the token required to connect to Automation Hub. Obtain the token [here](https://console.redhat.com/ansible/automation-hub/token).

Copy the token value and execute the following command:

```bash
export ANSIBLE_GALAXY_SERVER_AH_TOKEN=<token>
```
4 changes: 3 additions & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ roles_path=./roles
server_list = ah,galaxy

[galaxy_server.ah]
#url=https://cloud.redhat.com/api/automation-hub/
# Grab a token at https://console.redhat.com/ansible/automation-hub/token
# Then define it using ANSIBLE_GALAXY_SERVER_AH_TOKEN=""

url=https://console.redhat.com/api/automation-hub/content/published/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token

Expand Down

0 comments on commit ab5d87d

Please sign in to comment.