https://github.com/compscidr/ansible-github-cli
Roles for installing github cli and extensions via ansible
https://github.com/compscidr/ansible-github-cli
ansible extensions gh github-cli ubuntu
Last synced: about 16 hours ago
JSON representation
Roles for installing github cli and extensions via ansible
- Host: GitHub
- URL: https://github.com/compscidr/ansible-github-cli
- Owner: compscidr
- License: gpl-3.0
- Created: 2024-06-06T17:48:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-22T04:47:44.000Z (2 months ago)
- Last Synced: 2025-10-22T05:41:04.856Z (2 months ago)
- Topics: ansible, extensions, gh, github-cli, ubuntu
- Language: YAML
- Homepage:
- Size: 73.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-github-cli
[](https://galaxy.ansible.com/ui/repo/published/compscidr/github_cli/)
[](https://github.com/compscidr/ansible-github-cli/actions/workflows/check.yml)
[](https://ansible.readthedocs.io/projects/lint/rules/)
A collection of roles to:
- install github cli
- install gh extensions
## Usage
Add the collection to your meta/requirements.yml:
```
collections:
- name: compscidr.github_cli
version: ""
```
Install the collection:
```
ansible-galaxy install -r meta/requirements.yml
```
Use in a playbook:
```
- name: Install GH cli and extensions
hosts: *
roles:
- role: compscidr.github_cli.github_cli
vars:
github_cli_gh_token: "insert your gh token"
github_cli_user: "insert your username"
- role: compscidr.github_cli.github_cli_extension
vars:
github_cli_extension: "dlvhdr/gh-dash"
- role: compscidr.github_cli.github_cli_extension
vars:
github_cli_extension: "some other extension"
```
## Variables
Variable | Description
--------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
github_cli_gh_token | The GH API token that allows for reading / writing to repos
github_cli_user | The user to add the GH_TOKEN as env variable for (will append to .bashrc file)
github_cli_extension | The extension to install
## Local development and testing
So that you don't need to push and make a release every time:
```
ansible-galaxy collection build --force
ansible-galaxy collection install *tar.gz --force
```
## Testing molecule locally
Inside the ansible directory:
```
python -m venv venv
. venv/bin/activate
pip install molecule molecule-docker passlib
molecule test
```