From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F02BE1F8AC5 for ; Sat, 18 Oct 2025 02:32:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760754742; cv=none; b=TLk23z8fYAXjU6lkCD6u49oT2+c0yZsljVSFU3/nWd7/m3SyfnTebfc7qHMQWmamU0XnFZVoMQdVhvJ+6OUPebd0fG9TgFDuVTywc+a5fbvlZNfEqGDF3v4Qs+7ZIsfN3t/MUj45asQ9tXFQzXvlcS92JUw9KB9WQ28cfTxtORU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760754742; c=relaxed/simple; bh=3gB/U7EIvp8Ah1rHZqX5K58Nd+ZAAjErQDZhWCeowRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KjalswOl0KKLxFGqdDOBTwn1lRQwuOVngArgwWvOVXj65cZT0Dment9qjGHY4Hm616qYKQcsso/BiSrCGVLhibXy19AdCMO8+g76quunFoqUNEckZsOlU7xSMe3xEs3c4VHeGnTTr/vpeh7bDeUutZSV0S5NoXYExywCEND+OD8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=MhsSqaB1; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="MhsSqaB1" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=d0j9fso4iB4gGcWeMDqguRxWOBdzRqA/EQJrR8W9iWg=; b=MhsSqaB1jPhdMgSb9Kxw1Xy5l/ tGzEU2dC7+FPpG7z9ijxod5ifF9gYqB/nF54GeXNLZhqaS0CBvehLF7oh4ztZNB8IBsgJ1Y3qEf7k ls/QqMI/T1zhvp1yr60ByB/v27vP8sToSlR+BeiUJJ58iKVcSherGH/vozvz6Pf+MBD763aCjf3xe 2OCGWPjc2KNLbtVz3L69K6kJZrfam+Hs5qorXRVBpSOI1Tep74PMM5CZF49BmkTRomBt2VyfLFvqY bcQweOysrpmAOBjN6Cj0BCk6e6cqT7uIXTLnCDOvSa8DkvcTnvHMkKsgGX/dgKCozt0NyVApNl++k G6REvitQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1v9wjz-00000009Oo2-2xo9; Sat, 18 Oct 2025 02:32:19 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 4/5] install-go-deps: Add generic Go toolchain role Date: Fri, 17 Oct 2025 19:32:16 -0700 Message-ID: <20251018023218.2240269-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251018023218.2240269-1-mcgrof@kernel.org> References: <20251018023218.2240269-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain 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 --- .../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