collection of ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

42 lines
1005 B

- name: Install or update pip
package:
name: python3-pip
state: latest
become: yes
- name: install python packages
ansible.builtin.pip:
name: "{{ item }}"
loop:
- ansible
- kubernetes
- name: store ansible home as fact
set_fact:
ansible_home: "{{ ansible_env['HOME'] }}"
- name: Create kube directory if it does not exist
ansible.builtin.file:
path: "{{ ansible_home }}/.kube"
state: directory
mode: '0700'
owner: "{{ ansible_user }}"
- name: copy kube config to ansible home dir
copy:
src: /etc/rancher/k3s/k3s.yaml
dest: "{{ ansible_home }}/.kube/config"
mode: '0600'
owner: "{{ ansible_user }}"
remote_src: yes
become: yes
- name: install necessary ansible collections
community.general.ansible_galaxy_install:
type: collection
name: "{{ collection_name }}"
loop: "{{ k3s_collections_to_install }}"
loop_control:
loop_var: collection_name
environment:
PATH: "$PATH:{{ ansible_home }}/.local/bin"