From: Luis Chamberlain <mcgrof@kernel.org>
To: Chuck Lever <cel@kernel.org>, Daniel Gomez <da.gomez@kruces.com>,
kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 4/5] install-go-deps: Add generic Go toolchain role
Date: Fri, 17 Oct 2025 19:32:16 -0700 [thread overview]
Message-ID: <20251018023218.2240269-5-mcgrof@kernel.org> (raw)
In-Reply-To: <20251018023218.2240269-1-mcgrof@kernel.org>
Add reusable install-go-deps role that provides consistent Go toolchain
installation across all distributions:
- Debian/Ubuntu: golang-go
- Fedora/RHEL: golang
- SUSE: go
This modular role can be included by any workflow or role needing Go
support, following kdevops patterns for dependency management. Similar
to install-rust-deps, this provides a generic building block for
workflows that need Go tooling.
Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
.../tasks/install-deps/debian/main.yml | 10 +++++++++
.../tasks/install-deps/fedora/main.yml | 9 ++++++++
.../tasks/install-deps/main.yml | 21 +++++++++++++++++++
.../tasks/install-deps/redhat/main.yml | 9 ++++++++
.../tasks/install-deps/suse/main.yml | 9 ++++++++
.../roles/install-go-deps/tasks/main.yml | 15 +++++++++++++
6 files changed, 73 insertions(+)
create mode 100644 playbooks/roles/install-go-deps/tasks/install-deps/debian/main.yml
create mode 100644 playbooks/roles/install-go-deps/tasks/install-deps/fedora/main.yml
create mode 100644 playbooks/roles/install-go-deps/tasks/install-deps/main.yml
create mode 100644 playbooks/roles/install-go-deps/tasks/install-deps/redhat/main.yml
create mode 100644 playbooks/roles/install-go-deps/tasks/install-deps/suse/main.yml
create mode 100644 playbooks/roles/install-go-deps/tasks/main.yml
diff --git a/playbooks/roles/install-go-deps/tasks/install-deps/debian/main.yml b/playbooks/roles/install-go-deps/tasks/install-deps/debian/main.yml
new file mode 100644
index 00000000..79d21564
--- /dev/null
+++ b/playbooks/roles/install-go-deps/tasks/install-deps/debian/main.yml
@@ -0,0 +1,10 @@
+---
+- name: Install Go build dependencies
+ become: true
+ become_method: sudo
+ ansible.builtin.apt:
+ name:
+ - golang-go
+ state: present
+ update_cache: false
+ tags: ["go", "deps"]
diff --git a/playbooks/roles/install-go-deps/tasks/install-deps/fedora/main.yml b/playbooks/roles/install-go-deps/tasks/install-deps/fedora/main.yml
new file mode 100644
index 00000000..6926ce2f
--- /dev/null
+++ b/playbooks/roles/install-go-deps/tasks/install-deps/fedora/main.yml
@@ -0,0 +1,9 @@
+---
+- name: Install Go build dependencies
+ become: true
+ become_method: sudo
+ ansible.builtin.dnf:
+ name:
+ - golang
+ state: present
+ tags: ["go", "deps"]
diff --git a/playbooks/roles/install-go-deps/tasks/install-deps/main.yml b/playbooks/roles/install-go-deps/tasks/install-deps/main.yml
new file mode 100644
index 00000000..23cda58e
--- /dev/null
+++ b/playbooks/roles/install-go-deps/tasks/install-deps/main.yml
@@ -0,0 +1,21 @@
+---
+- name: Import optional distribution specific variables
+ ansible.builtin.include_vars: "{{ item }}"
+ ignore_errors: true
+ with_first_found:
+ - files:
+ - "{{ ansible_facts['os_family'] | lower }}.yml"
+ skip: true
+ tags: vars
+
+- name: Distribution specific setup
+ ansible.builtin.import_tasks: debian/main.yml
+ when: ansible_facts['os_family']|lower == 'debian'
+- ansible.builtin.import_tasks: suse/main.yml
+ when: ansible_facts['os_family']|lower == 'suse'
+- ansible.builtin.import_tasks: redhat/main.yml
+ when:
+ - ansible_facts['os_family']|lower == 'redhat'
+ - ansible_facts['distribution']|lower != "fedora"
+- ansible.builtin.import_tasks: fedora/main.yml
+ when: ansible_facts['distribution']|lower == "fedora"
diff --git a/playbooks/roles/install-go-deps/tasks/install-deps/redhat/main.yml b/playbooks/roles/install-go-deps/tasks/install-deps/redhat/main.yml
new file mode 100644
index 00000000..6926ce2f
--- /dev/null
+++ b/playbooks/roles/install-go-deps/tasks/install-deps/redhat/main.yml
@@ -0,0 +1,9 @@
+---
+- name: Install Go build dependencies
+ become: true
+ become_method: sudo
+ ansible.builtin.dnf:
+ name:
+ - golang
+ state: present
+ tags: ["go", "deps"]
diff --git a/playbooks/roles/install-go-deps/tasks/install-deps/suse/main.yml b/playbooks/roles/install-go-deps/tasks/install-deps/suse/main.yml
new file mode 100644
index 00000000..3898b572
--- /dev/null
+++ b/playbooks/roles/install-go-deps/tasks/install-deps/suse/main.yml
@@ -0,0 +1,9 @@
+---
+- name: Install Go build dependencies
+ become: true
+ become_method: sudo
+ community.general.zypper:
+ name:
+ - go
+ state: present
+ tags: ["go", "deps"]
diff --git a/playbooks/roles/install-go-deps/tasks/main.yml b/playbooks/roles/install-go-deps/tasks/main.yml
new file mode 100644
index 00000000..b248ccf8
--- /dev/null
+++ b/playbooks/roles/install-go-deps/tasks/main.yml
@@ -0,0 +1,15 @@
+---
+- name: Import optional extra_args file
+ ansible.builtin.include_vars: "{{ item }}"
+ ignore_errors: true
+ with_first_found:
+ - files:
+ - "../extra_vars.yml"
+ - "../extra_vars.yaml"
+ - "../extra_vars.json"
+ skip: true
+ tags: vars
+
+# Install Go build dependencies
+- name: Install Go build dependencies
+ ansible.builtin.include_tasks: install-deps/main.yml
--
2.51.0
next prev parent reply other threads:[~2025-10-18 2:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-18 2:32 [PATCH 0/5] rust + rcloud support Luis Chamberlain
2025-10-18 2:32 ` [PATCH 1/5] install-rust-deps: Add generic Rust toolchain role Luis Chamberlain
2025-10-18 2:32 ` [PATCH 2/5] CLAUDE.md: Add Rust code quality requirements Luis Chamberlain
2025-10-18 2:32 ` [PATCH 3/5] bootlinux: Integrate Rust toolchain dependencies Luis Chamberlain
2025-10-18 2:32 ` Luis Chamberlain [this message]
2025-10-18 2:32 ` [PATCH 5/5] rcloud: Add experimental private cloud infrastructure for bare metal Luis Chamberlain
2025-10-18 18:22 ` [PATCH 0/5] rust + rcloud support Chuck Lever
2025-10-21 16:58 ` Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251018023218.2240269-5-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=cel@kernel.org \
--cc=da.gomez@kruces.com \
--cc=kdevops@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox