202 lines
7.8 KiB
YAML
202 lines
7.8 KiB
YAML
---
|
|
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
|
|
|
# .. Copyright (C) 2015 Nick Janetakis <nickjanetakis@gmail.com>
|
|
# .. Copyright (C) 2016-2019 Maciej Delmanowski <drybjed@gmail.com>
|
|
# .. Copyright (C) 2015-2019 DebOps <https://debops.org/>
|
|
# .. SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
# .. _golang__ref_defaults:
|
|
|
|
# debops.golang default variables
|
|
# ===============================
|
|
|
|
# .. contents::
|
|
# :local:
|
|
|
|
# Go UNIX environment [[[
|
|
# -----------------------
|
|
|
|
# .. envvar:: golang__user [[[
|
|
#
|
|
# Name of an unprivileged UNIX system account which will host the Go build
|
|
# environment.
|
|
golang__user: '_golang'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__group [[[
|
|
#
|
|
# Name of the primary UNIX group of the Go UNIX account.
|
|
golang__group: '_golang'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__home [[[
|
|
#
|
|
# Absolute path to the home directory of the Go UNIX account.
|
|
golang__home: '{{ (ansible_local.fhs.home | d("/var/local"))
|
|
+ "/" + golang__user }}'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__shell [[[
|
|
#
|
|
# The default shell used by the Go UNIX account.
|
|
golang__shell: '/usr/sbin/nologin'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__comment [[[
|
|
#
|
|
# The value of the GECOS field of the Go UNIX account.
|
|
golang__comment: 'Go build environment'
|
|
# ]]]
|
|
# ]]]
|
|
# Go source builds and binaries [[[
|
|
# ---------------------------------
|
|
|
|
# .. envvar:: golang__apt_dev_packages [[[
|
|
#
|
|
# List of base APT packages installed when a source build is required.
|
|
golang__apt_dev_packages: [ 'golang-go', 'make' ]
|
|
|
|
# ]]]
|
|
# .. envvar:: 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'
|
|
|
|
# ]]]
|
|
# .. envvar:: 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" }}'
|
|
|
|
# ]]]
|
|
# .. envvar:: 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
|
|
# :command:`go install` command, which are usually not needed in the normal
|
|
# host environment.
|
|
golang__env_path: '{{ golang__home + "/go/bin:" + ansible_env.PATH }}'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__gosrc [[[
|
|
#
|
|
# Absolute path to the directory where Go application sources will be cloned
|
|
# using the :command:`git` command, as the unprivileged Go UNIX account.
|
|
golang__gosrc: '{{ golang__home + "/go/src" }}'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__git_depth [[[
|
|
#
|
|
# The default depth used to create a "shallow clone" of the :command:`git`
|
|
# repositories if not specified otherwise, minimum 1. If not specified, entire
|
|
# :command:`git` repository is cloned.
|
|
golang__git_depth: '0'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__bin_database [[[
|
|
#
|
|
# Absolute path to a file which tracks what Go binaries have been installed by
|
|
# the :ref:`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 :ref:`debops.golang` role.
|
|
# See the :ref:`golang__ref_packages` documentation for more details.
|
|
|
|
# .. envvar:: 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" }}'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__packages [[[
|
|
#
|
|
# List of Go packages to install on all hosts in Ansible inventory.
|
|
golang__packages: []
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__group_packages [[[
|
|
#
|
|
# List of Go packages to install on a group of hosts in Ansible inventory.
|
|
golang__group_packages: []
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__host_packages [[[
|
|
#
|
|
# List of Go packages to install on specific hosts in Ansible inventory.
|
|
golang__host_packages: []
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__dependent_packages [[[
|
|
#
|
|
# List of Go packages to install specified by other Ansible roles.
|
|
golang__dependent_packages: []
|
|
|
|
# ]]]
|
|
# .. envvar:: 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 [[[
|
|
# -----------------------------------------
|
|
|
|
# .. envvar:: golang__keyring__dependent_gpg_user [[[
|
|
#
|
|
# Configuration for the :ref:`debops.keyring` Ansible role (all GPG keys should
|
|
# be imported into a specific UNIX account keyring).
|
|
golang__keyring__dependent_gpg_user: '{{ golang__user }}'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__keyring__dependent_gpg_keys [[[
|
|
#
|
|
# Configuration for the :ref:`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) | debops.debops.parse_kv_items
|
|
| selectattr("gpg", "defined") | selectattr("state", "equalto", "present")
|
|
| map(attribute="gpg") | list)
|
|
else "absent" }}'
|
|
|
|
- '{{ q("flattened", golang__combined_packages) | debops.debops.parse_kv_items
|
|
| selectattr("gpg", "defined") | selectattr("state", "equalto", "present")
|
|
| map(attribute="gpg") | list }}'
|
|
|
|
# ]]]
|
|
# .. envvar:: golang__apt_preferences__dependent_list [[[
|
|
#
|
|
# Configuration for the :ref:`debops.apt_preferences` role.
|
|
golang__apt_preferences__dependent_list:
|
|
|
|
- packages: [ 'golang', 'golang-*', 'dh-golang' ]
|
|
backports: [ 'stretch', 'buster', 'trusty' ]
|
|
reason: 'Closer feature parity with upstream'
|
|
by_role: 'debops.golang'
|
|
|
|
# ]]]
|
|
# ]]]
|