Manage remote repository with the motemen/ghq. Although this is distributed in the Ansible Galaxy, this is not an Ansible role but an Ansible Module and Action Plugin.
https://galaxy.ansible.com/suzuki-shunsuke/ghq-module/
- This module doesn't support the check mode.
- Go
- motemen/ghq
This module is distributed in the Ansible Galaxy.
So you can install this with tha ansible-galaxy
command.
$ ansible-galaxy install suzuki-shunsuke.ghq-module
# playbook.yml
- hosts: default
roles:
# After you call this module, you can use this
- suzuki-shunsuke.ghq-module
parameter | required | default | choices | comments |
---|---|---|---|---|
name | no | The repository path | ||
executable | no | The executable path of 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 of "ghq import" command | ||
subcommand | no | get | get | The subcommand of "ghq import" command |
# Clone suzuki-shunsuke/zsh.conf
ghq:
name: suzuki-shunsuke/zsh.conf
# Specify the path of ghq command
ghq:
name: suzuki-shunsuke/zsh.conf
executable: "{{ansible_env.HOME}}/.go/bin/ghq"
# Update
go:
name: suzuki-shunsuke/zsh.conf
update: yes
# Via ssh
ghq:
name: suzuki-shunsuke/zsh.conf
ssh: yes
# Shallow clone
ghq:
name: suzuki-shunsuke/zsh.conf
shallow: yes
# Import from file
# Empty lines and started with sharp("#") lines are ignored
ghq:
src: repos.txt
# Import via subcommand
ghq:
subcommand: starred motemen
# Subcommand is either str or list of str
ghq:
subcommand: ["starred", "motemen"]
MIT
- Vagrant
- Ansible
$ cd tests
$ ansible-galaxy install -r roles.yml
$ cd tests
$ vagrant up --provision-with=ansible
$ vagrant up --provision-with=ansible_local
$ ansible-playbook test.yml