machine_setup/ansible/roles/kubernetes/tasks/common.yaml

57 lines
1.3 KiB
YAML
Raw Normal View History

2022-12-02 04:38:21 +00:00
- name: Install packages
package:
name:
- kubectl
- jq # for decrypt_k8s_secret
- helm
- sops # Encrypt secrets
2023-06-01 19:36:39 +00:00
- cfssl # For generating certs for self-hosted cluster
2022-12-02 04:38:21 +00:00
state: present
# TODO: Make a FreeBSD package for kubeswitch or kubectx
# TODO: Make a FreeBSD package for stern
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: k
dest: /usr/local/bin/k
- src: ka
dest: /usr/local/bin/ka
- src: kd
dest: /usr/local/bin/kd
- src: kdel
dest: /usr/local/bin/kdel
- src: klog
dest: /usr/local/bin/klog
- src: ks
dest: /usr/local/bin/ks
- src: kshell
dest: /usr/local/bin/kshell
- src: kx
dest: /usr/local/bin/kx
- src: decrypt_k8s_secret
dest: /usr/local/bin/decrypt_k8s_secret
- src: k8s_delete_pipeline_runs
dest: /usr/local/bin/
2022-12-02 04:38:21 +00:00
- import_tasks: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/linux.yaml
when: 'os_flavor == "linux"'
- include_tasks:
file: tasks/peruser.yaml
apply:
become: yes
become_user: "{{ initialize_user }}"
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
loop_control:
loop_var: initialize_user