ansible module to run gvm command.
https://galaxy.ansible.com/suzuki-shunsuke/gvm-module/
- This module doesn't support the check mode
- gvm is the abbreviation for Go Version Manager, and this module has nothing to do with Groovy enVironment Manager.
- GenericLinux
- MacOSX
We test this module in
- Ubuntu 16.04 (Vagrant, Virtualbox)
- CentOS 7.3 (Vagrant, Virtualbox)
- MaxOS Sierra 10.12.5
If you want to install gvm and golang build dependencies with ansible role, we recommend the suzuki-shunsuke.gvm.
$ gvm install <version> [--binary] [--prefer-binary] [--with-build-tools] [--with-protobuf]
$ gvm uninstall <version>
$ gvm list
$ gvm listall
$ gvm alias list
$ gvm alias create <alias> <version>
$ gvm alias delete <alias>
$ ansible-galaxy install suzuki-shunsuke.gvm-module
# playbook.yml
- hosts: default
roles:
# After you call this role, you can use this module.
- suzuki-shunsuke.gvm-module
name | type | required | default | choices / example | description |
---|---|---|---|---|---|
subcommand | str | no | install | [install, uninstall, list, listall, alias list, alias create, alias delete] | |
gvm_root | str | no | ~/.gvm | If the environment variable "GVM_ROOT" is not set, this option is required | |
expanduser | bool | no | yes | By default the environment variable GVM_ROOT and "gvm_root" option are filtered by os.path.expanduser |
parameter | type | required | default | choices / example | description |
---|---|---|---|---|---|
version | str | yes | go1.4 | ||
binary | bool | no | no | If you want to avoid compile errors, we recommend to set this option to "yes" | |
prefer_binary | bool | no | no | ||
with_build_tools | bool | no | no | ||
with_protobuf | bool | no | no |
parameter | type | required | default | choices / example | description |
---|---|---|---|---|---|
version | str | yes | go1.4 |
Nothing.
The return value of the "list" subcommand has "versions" field.
Nothing.
The return value of the "listall" subcommand has "versions" field.
Nothing.
The return value of the "alias list" subcommand has "aliases" field.
parameter | type | required | default | choices / example | description |
---|---|---|---|---|---|
version | str | yes | go1.4 | ||
alias | str | yes | foo |
parameter | type | required | default | choices / example | description |
---|---|---|---|---|---|
alias | str | yes | foo |
- name: gvm install go1.4
gvm:
version: go1.4
gvm_root: "~/.gvm"
- name: gvm install go1.5 --binary
gvm:
version: go1.5
gvm_root: "~/.gvm"
binary: yes
- name: gvm uninstall go1.5
gvm:
subcommand: uninstall
version: go1.5
gvm_root: "~/.gvm"
- name: gvm list
gvm:
subcommand: list
gvm_root: "~/.gvm"
register: result
- debug:
var: result.versions
- name: gvm listall
gvm:
subcommand: listall
gvm_root: "~/.gvm"
register: result
- debug:
var: result.versions
- name: gvm alias create foo go1.4
gvm:
subcommand: alias create
version: go1.4
alias: foo
gvm_root: "~/.gvm"
- name: gvm alias list
gvm:
subcommand: alias list
gvm_root: "~/.gvm"
register: result
- debug:
var: result.aliases
- name: gvm alias delete foo
gvm:
subcommand: alias delete
alias: foo
gvm_root: "~/.gvm"
See CHANGELOG.md.
- suzuki-shunsuke.gvm: ansible role to install gvm
- Vagrant
- Ansible
- Node.js
- yarn
$ yarn install
$ cd tests
$ ansible-galaxy install -r roles.yml
$ cd tests
$ vagrant up --provision