suzuki-shunsuke.ghq-module
ansible-ghq-module
This module helps you manage remote repositories using motemen/ghq. It's available on Ansible Galaxy, but it’s not an Ansible role—it's an Ansible Module and Action Plugin.
You can find it here: https://galaxy.ansible.com/suzuki-shunsuke/ghq-module/
Important Note
- This module does not support check mode.
Requirements
- Go
- motemen/ghq
Installation
You can install this module from Ansible Galaxy using the ansible-galaxy
command.
$ ansible-galaxy install suzuki-shunsuke.ghq-module
# playbook.yml
- hosts: default
roles:
# Use this module after calling it
- suzuki-shunsuke.ghq-module
Options
Parameter | Required | Default | Choices | Comments |
---|---|---|---|---|
name | No | The repository path | ||
executable | No | The path to the ghq command | ||
update | No | No | bool | If yes, the -u option is added |
ssh | No | No | bool | If yes, the -p option is added |
shallow | No | No | bool | If yes, the --shallow option is added |
src | No | The source path for the "ghq import" command | ||
subcommand | No | get | get | The subcommand for the "ghq import" command |
Examples
# Clone the repository suzuki-shunsuke/zsh.conf
ghq:
name: suzuki-shunsuke/zsh.conf
# Specify the path of the ghq command
ghq:
name: suzuki-shunsuke/zsh.conf
executable: "{{ansible_env.HOME}}/.go/bin/ghq"
# Update the repository
ghq:
name: suzuki-shunsuke/zsh.conf
update: yes
# Clone via SSH
ghq:
name: suzuki-shunsuke/zsh.conf
ssh: yes
# Perform a shallow clone
ghq:
name: suzuki-shunsuke/zsh.conf
shallow: yes
# Import repositories from a file
# Empty lines and lines starting with a "#" will be ignored
ghq:
src: repos.txt
# Import using a subcommand
ghq:
subcommand: starred motemen
# You can also specify subcommand as a list
ghq:
subcommand: ["starred", "motemen"]
License
MIT
For Developers
Requirements
- Vagrant
- Ansible
Setup Test
$ cd tests
$ ansible-galaxy install -r roles.yml
Test in Vagrant Provisioning
$ cd tests
$ vagrant up --provision-with=ansible
$ vagrant up --provision-with=ansible_local
Test on Localhost
$ ansible-playbook test.yml
Informazioni sul progetto
Manage remote repository with the motemen/ghq. This is not an Ansible role but an Ansible Module and Action Plugin.
Installa
ansible-galaxy install suzuki-shunsuke.ghq-module
Licenza
mit
Download
341
Proprietario
Platform Engineer / OSS Developer / Go