1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-07-01 16:18:55 +00:00
community.general/tests/integration/targets/golang_package/tasks/setup.yml
Shreyash b34ef22c82
add go module to manage Go packages via go install (#12152)
* add golang_package module to manage Go packages via go install

Adds a new module to install, update, and remove Go packages
using go install. Supports inline version pinning in package
names (e.g. pkg/tool/cmd with version suffix).

Assisted-by: Claude Opus 4.6
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix copyright year and BOTMETA alphabetical order

* fix environment keyword docs, add integration test aliases

- Use C(environment) instead of O(ignore:environment) for task keyword
- Add tests/integration/targets/golang_package/aliases for CI
- Fix setup.yml: handle Alpine/ArchLinux/FreeBSD package names, skip Go < 1.16
- Pin tests to x/tools v0.24.1 (only version compatible with Go 1.16-1.25)

Co-authored-by: Cursor <cursoragent@cursor.com>

* test signing trace

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 12:06:39 +02:00

27 lines
833 B
YAML

---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Determine Go package name
set_fact:
golang_package_name: >-
{{ 'go' if ansible_facts.os_family in ['Alpine', 'Archlinux', 'FreeBSD'] else 'golang' }}
- block:
- name: Install Go
package:
name: "{{ golang_package_name }}"
state: present
- name: Check Go version
command: go version
register: go_version_output
changed_when: false
- name: Set has_go if Go >= 1.19
set_fact:
has_go: true
when: (go_version_output.stdout | regex_search('go(\d+\.\d+)', '\\1') | first) is version('1.19', '>=')
when:
- ansible_facts.distribution != 'MacOSX'