Skip to content

Commit

Permalink
Add k9s role (#658)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt authored May 31, 2024
1 parent f03ee21 commit f553712
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@
- '^roles\/ipimtool\/.*$'
- '^molecule\/delegated\/tests\/ipmitool.*$'

- job:
name: ansible-collection-commons-molecule-k9s
parent: abstract-ansible-collection-commons-molecule
vars:
ansible_role: k9s
files:
- '^roles\/k9s\/.*$'
- '^molecule\/delegated\/tests\/k9s.*$'

- job:
name: ansible-collection-commons-molecule-kernel_modules
parent: abstract-ansible-collection-commons-molecule
Expand Down Expand Up @@ -394,6 +403,7 @@
- ansible-collection-commons-molecule-hostname
- ansible-collection-commons-molecule-hosts
- ansible-collection-commons-molecule-ipmitool
- ansible-collection-commons-molecule-k9s
- ansible-collection-commons-molecule-kernel_modules
- ansible-collection-commons-molecule-known_hosts
- ansible-collection-commons-molecule-kompose
Expand Down Expand Up @@ -436,6 +446,7 @@
- ansible-collection-commons-molecule-hostname
- ansible-collection-commons-molecule-hosts
- ansible-collection-commons-molecule-ipmitool
- ansible-collection-commons-molecule-k9s
- ansible-collection-commons-molecule-kernel_modules
- ansible-collection-commons-molecule-known_hosts
- ansible-collection-commons-molecule-kompose
Expand Down
1 change: 1 addition & 0 deletions molecule/delegated/prepare/k9s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
3 changes: 3 additions & 0 deletions molecule/delegated/tests/k9s.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def test_runc_package(host):
package = host.package("k9s")
assert package.is_installed
1 change: 1 addition & 0 deletions molecule/delegated/vars/k9s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
1 change: 1 addition & 0 deletions molecule/delegated/verify/k9s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
Empty file added roles/k9s/README.md
Empty file.
3 changes: 3 additions & 0 deletions roles/k9s/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
k9s_version: v0.32.4
k9s_base_url: https://github.com/derailed/k9s/releases/download
22 changes: 22 additions & 0 deletions roles/k9s/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
galaxy_info:
author: Christian Berendt
description: Role osism.commons.k9s
company: OSISM GmbH
license: Apache License 2.0
min_ansible_version: 2.16.0
platforms:
- name: Ubuntu
versions:
- jammy
- noble
- name: Debian
versions:
- bookworm
- name: EL
versions:
- "9"
galaxy_tags:
- osism
- system
dependencies: []
6 changes: 6 additions & 0 deletions roles/k9s/tasks/install-Debian-family.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Install k9s packages
become: true
ansible.builtin.apt:
deb: "{{ k9s_base_url }}/{{ k9s_version }}/{{ k9s_package_file }}"
state: present
7 changes: 7 additions & 0 deletions roles/k9s/tasks/install-RedHat-family.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Install k9s package
become: true
ansible.builtin.dnf:
name: "{{ k9s_base_url }}/{{ k9s_version }}/{{ k9s_package_file }}"
disable_gpg_check: true
state: present
6 changes: 6 additions & 0 deletions roles/k9s/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Gather variables for each operating system
ansible.builtin.include_vars: "{{ ansible_os_family }}-family.yml"

- name: Include distribution specific install tasks
ansible.builtin.include_tasks: "install-{{ ansible_os_family }}-family.yml"
2 changes: 2 additions & 0 deletions roles/k9s/vars/Debian-family.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
k9s_package_file: k9s_linux_amd64.deb
2 changes: 2 additions & 0 deletions roles/k9s/vars/RedHat-family.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
k9s_package_file: k9s_linux_amd64.rpm

0 comments on commit f553712

Please sign in to comment.