From 7bf26cdb70d6a799fda163863bca252746a5ca00 Mon Sep 17 00:00:00 2001 From: Giovanni Tirloni Date: Wed, 12 Jun 2024 11:40:37 -0300 Subject: [PATCH] Add support_bundle role Related: vexxhost/atmosphere#1078 --- roles/kubectl/meta/main.yml | 1 + roles/support_bundle/README.md | 4 ++++ roles/support_bundle/defaults/main.yml | 14 +++++++++++++ roles/support_bundle/meta/main.yml | 27 ++++++++++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 roles/support_bundle/README.md create mode 100644 roles/support_bundle/defaults/main.yml create mode 100644 roles/support_bundle/meta/main.yml diff --git a/roles/kubectl/meta/main.yml b/roles/kubectl/meta/main.yml index 0ddec043..d854e01c 100644 --- a/roles/kubectl/meta/main.yml +++ b/roles/kubectl/meta/main.yml @@ -29,6 +29,7 @@ galaxy_info: - jammy dependencies: + - role: support_bundle - role: vexxhost.containers.forget_package forget_package_name: "{{ kubectl_package_name }}" when: ansible_facts['pkg_mgr'] == "apt" diff --git a/roles/support_bundle/README.md b/roles/support_bundle/README.md new file mode 100644 index 00000000..97ee7a96 --- /dev/null +++ b/roles/support_bundle/README.md @@ -0,0 +1,4 @@ +# `support-bundle` + +This role installs `support-bundle` on the host by downloading the binary from the +official Replicated project. diff --git a/roles/support_bundle/defaults/main.yml b/roles/support_bundle/defaults/main.yml new file mode 100644 index 00000000..c26d6c2e --- /dev/null +++ b/roles/support_bundle/defaults/main.yml @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) VEXXHOST, Inc. + +support_bundle_version: 0.93.3 + +support_bundle_checksums: + amd64: + 0.93.3: 4ddff0865de75f88d7ab7e088cdf309e54af85a8bbd97346c04e72e269a6a351 + arm64: + 0.93.3: 9572085f23d437817d929ebb5db5e0df3747c34105ad937973d61d8f4e0eb687 + +support_bundle_download_url: "https://github.com/replicatedhq/troubleshoot/releases/download/v{{ support_bundle_version }}/support-bundle_linux_{{ download_artifact_goarch }}.tar.gz" # noqa: yaml[line-length] +support_bundle_download_dest: /usr/bin/kubectl-support_bundle +support_bundle_binary_checksum: "{{ support_bundle_checksums[download_artifact_goarch][support_bundle_version] }}" diff --git a/roles/support_bundle/meta/main.yml b/roles/support_bundle/meta/main.yml new file mode 100644 index 00000000..f65d7230 --- /dev/null +++ b/roles/support_bundle/meta/main.yml @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) VEXXHOST, Inc. + +galaxy_info: + author: VEXXHOST, Inc. + description: Ansible role for "support-bundle" + license: Apache-2.0 + min_ansible_version: 5.5.0 + standalone: false + platforms: + - name: EL + versions: + - "8" + - "9" + - name: Ubuntu + versions: + - focal + - jammy + +dependencies: + - role: vexxhost.containers.download_artifact + download_artifact_url: "{{ support_bundle_download_url }}" + download_artifact_dest: "{{ support_bundle_download_dest }}" + download_artifact_unarchive_include: support-bundle + download_artifact_checksum: "sha256:{{ support_bundle_binary_checksum }}" + download_artifact_owner: root + download_artifact_mode: "0755"