debops.golang default variables

Go UNIX environment

golang__user

Name of an unprivileged UNIX system account which will host the Go build environment.

golang__user: '_golang'
golang__group

Name of the primary UNIX group of the Go UNIX account.

golang__group: '_golang'
golang__home

Absolute path to the home directory of the Go UNIX account.

golang__home: '{{ (ansible_local.fhs.home | d("/var/local"))
                  + "/" + golang__user }}'
golang__shell

The default shell used by the Go UNIX account.

golang__shell: '/usr/sbin/nologin'
golang__comment

The value of the GECOS field of the Go UNIX account.

golang__comment: 'Go build environment'

Go source builds and binaries

golang__apt_dev_packages

List of base APT packages installed when a source build is required.

golang__apt_dev_packages: [ 'golang-go', 'make' ]
golang__env_gopath

The value of the $GOPATH environment variable, which defines a list of directories outside of the current Go environment that contain Go sources and packages, separated by colons.

golang__env_gopath: '{{ golang__home + "/go" }}:/usr/share/gocode'
golang__env_gocache

The value of the $GOCACHE environment variable used during Go builds. This variable specifies the directory which holds the Go build cache.

golang__env_gocache: '{{ golang__home + "/.cache/go" }}'
golang__env_path

The value of the $PATH environment variable used during Go builds. This value allows access to the binaries on the Go UNIX account installed by the go install command, which are usually not needed in the normal host environment.

golang__env_path: '{{ golang__home + "/go/bin:" + ansible_env.PATH }}'
golang__gosrc

Absolute path to the directory where Go application sources will be cloned using the git command, as the unprivileged Go UNIX account.

golang__gosrc: '{{ golang__home + "/go/src" }}'
golang__git_depth

The default depth used to create a "shallow clone" of the git repositories if not specified otherwise, minimum 1. If not specified, entire git repository is cloned.

golang__git_depth: '0'
golang__bin_database

Absolute path to a file which tracks what Go binaries have been installed by the debops.golang role and is used by the Ansible local fact to resolve the paths to preferred binaries.

golang__bin_database: '/usr/local/etc/golang-binaries'

Go packages

The golang__*_packages default variables define what Go packages should be installed by the debops.golang role. See the golang__packages documentation for more details.

golang__default_packages

List of default Go packages to install, defined by the role.

golang__default_packages:

  # The Go environment will be installed if no dependent Go packages are defined
  - name: 'golang-go'
    apt_packages: 'golang-go'
    state: '{{ "ignore" if golang__dependent_packages|d() else "present" }}'
golang__packages

List of Go packages to install on all hosts in Ansible inventory.

golang__packages: []
golang__group_packages

List of Go packages to install on a group of hosts in Ansible inventory.

golang__group_packages: []
golang__host_packages

List of Go packages to install on specific hosts in Ansible inventory.

golang__host_packages: []
golang__dependent_packages

List of Go packages to install specified by other Ansible roles.

golang__dependent_packages: []
golang__combined_packages

List of Go packages which combines all other lists and is used in the role tasks.

golang__combined_packages: '{{ golang__default_packages
                               + golang__dependent_packages
                               + golang__packages
                               + golang__group_packages
                               + golang__host_packages }}'

Configuration for other Ansible roles

golang__keyring__dependent_gpg_user

Configuration for the debops.keyring Ansible role (all GPG keys should be imported into a specific UNIX account keyring).

golang__keyring__dependent_gpg_user: '{{ golang__user }}'
golang__keyring__dependent_gpg_keys

Configuration for the debops.keyring Ansible role (list of GPG keys to import to the keyring).

golang__keyring__dependent_gpg_keys:

  - user:  '{{ golang__user }}'
    group: '{{ golang__group }}'
    home:  '{{ golang__home }}'
    state: '{{ "present"
               if (q("flattened", golang__combined_packages) | parse_kv_items
                   | selectattr("gpg", "defined") | selectattr("state", "equalto", "present")
                   | map(attribute="gpg") | list)
               else "absent" }}'

  - '{{ q("flattened", golang__combined_packages) | parse_kv_items
        | selectattr("gpg", "defined") | selectattr("state", "equalto", "present")
        | map(attribute="gpg") | list }}'
golang__apt_preferences__dependent_list

Configuration for the debops.apt_preferences role.

golang__apt_preferences__dependent_list:

  - packages: [ 'golang', 'golang-*', 'dh-golang' ]
    backports: [ 'wheezy', 'jessie', 'stretch', 'buster', 'precise', 'trusty' ]
    reason: 'Closer feature parity with upstream'
    by_role: 'debops.golang'