forked from fabianlee/k3s-cluster-kvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_dependencies.yml
99 lines (83 loc) · 3.96 KB
/
install_dependencies.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
# get latest ansible role for installing microk8s
- hosts: localhost
become: no
tasks:
- debug:
msg: "OS release={{ ansible_distribution_release }}, OS version={{ ansible_distribution_version }}"
- name: fetch k3s ansible role from github
delegate_to: localhost
git:
repo: https://github.com/k3s-io/k3s-ansible.git
clone: true
dest: "{{playbook_dir}}/../k3s-ansible"
- name: make collections directory
file:
path: "{{playbook_dir}}/../collections"
state: directory
# https://galaxy.ansible.com/community/kubernetes
- name: get community.kubernetes collection from ansible galaxy, be patient can take 5 minutes
command:
cmd: ansible-galaxy collection install community.kubernetes:2.0.1 -p .
creates: "{{playbook_dir}}/../collections/ansible_collections/community/kubernetes"
chdir: "{{playbook_dir}}/../collections"
# https://galaxy.ansible.com/community/crypto
- name: get community.crypto collection from ansible galaxy, be patient can take 5 minutes
command:
cmd: ansible-galaxy collection install community.crypto:2.2.1 -p .
creates: "{{playbook_dir}}/../collections/ansible_collections/community/crypto"
chdir: "{{playbook_dir}}/../collections"
# https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters_ipaddr.html
# still required for 'ansible.netcommon' collection to work
- name: install local packages needed for ipaddr jinja2 filter
delegate_to: localhost
become: yes
apt:
pkg:
- python3-netaddr
state: present
- name: install local packages needed for ipaddr jinja2 filter, only for older Ubuntu
delegate_to: localhost
become: yes
apt:
pkg:
- python-netaddr
state: present
when: ansible_distribution_version is version('22.04','<')
# https://galaxy.ansible.com/ansible/netcommon
- name: get ansible.netcommon collection from ansible galaxy, be patient can take 5 minutes
command:
cmd: ansible-galaxy collection install ansible.netcommon:2.2.0 -p .
creates: "{{playbook_dir}}/../collections/ansible_collections/ansible/netcommon"
chdir: "{{playbook_dir}}/../collections"
# sysctl and NFS mount
# https://galaxy.ansible.com/ansible/posix
- name: get ansible.posix collection from ansible galaxy, be patient can take 5 minutes
command:
cmd: ansible-galaxy collection install ansible.posix:1.2.1-dev4 -p .
creates: "{{playbook_dir}}/../collections/ansible_collections/ansible/posix"
chdir: "{{playbook_dir}}/../collections"
# used for 'pam_limits'
# https://galaxy.ansible.com/community/general, 3.4.0 originally
# was getting errors on all 3.x versions from django tests, had to switch to 4.x
# "ERROR! Unable to extract 'tests/integration/targets/django_manage/files/base_test/1045-single-app-project/single_app_project/core/' from collection"
- name: get community.general collection from ansible galaxy, be patient can take 5 minutes
command:
cmd: ansible-galaxy collection install community.general:4.8.6 -p .
creates: "{{playbook_dir}}/../collections/ansible_collections/community/general"
chdir: "{{playbook_dir}}/../collections"
# https://docs.ansible.com/ansible/latest/collections/community/libvirt/virt_net_module.html
# required for 'community.libvirt' collection to work
- name: install local packages needed for community.libvirt
delegate_to: localhost
become: yes
apt:
pkg:
- python3-libvirt
- python3-lxml
state: present
- name: get community.libvirt collection from ansible galaxy, be patient can take 5 minutes
command:
cmd: ansible-galaxy collection install community.libvirt:1.0.2 -p .
creates: "{{playbook_dir}}/../collections/ansible_collections/community/libvirt"
chdir: "{{playbook_dir}}/../collections"