2020-04-22 21:09:52 +08:00
|
|
|
---
|
|
|
|
- name: Prepare
|
|
|
|
hosts: all
|
2024-08-28 13:30:56 +08:00
|
|
|
gather_facts: false
|
2022-10-19 20:47:05 +08:00
|
|
|
become: true
|
|
|
|
vars:
|
|
|
|
ignore_assert_errors: true
|
2020-04-22 21:09:52 +08:00
|
|
|
roles:
|
2022-10-19 20:47:05 +08:00
|
|
|
- role: kubespray-defaults
|
2020-04-22 21:09:52 +08:00
|
|
|
- role: bootstrap-os
|
2022-10-19 20:47:05 +08:00
|
|
|
- role: kubernetes/preinstall
|
|
|
|
- role: adduser
|
|
|
|
user: "{{ addusers.kube }}"
|
|
|
|
tasks:
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Download CNI
|
|
|
|
include_tasks: "../../../../download/tasks/download_file.yml"
|
2022-10-19 20:47:05 +08:00
|
|
|
vars:
|
|
|
|
download: "{{ download_defaults | combine(downloads.cni) }}"
|
|
|
|
|
|
|
|
- name: Prepare CNI
|
|
|
|
hosts: all
|
2024-08-28 13:30:56 +08:00
|
|
|
gather_facts: false
|
2022-10-19 20:47:05 +08:00
|
|
|
become: true
|
|
|
|
vars:
|
|
|
|
ignore_assert_errors: true
|
|
|
|
kube_network_plugin: cni
|
|
|
|
roles:
|
|
|
|
- role: kubespray-defaults
|
|
|
|
- role: network_plugin/cni
|
|
|
|
tasks:
|
|
|
|
- name: Copy test container files
|
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "/tmp/{{ item }}"
|
|
|
|
owner: root
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2022-10-19 20:47:05 +08:00
|
|
|
with_items:
|
|
|
|
- container.json
|
|
|
|
- sandbox.json
|
|
|
|
- name: Create /etc/cni/net.d directory
|
|
|
|
file:
|
|
|
|
path: /etc/cni/net.d
|
|
|
|
state: directory
|
|
|
|
owner: "{{ kube_owner }}"
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0755"
|
2022-10-19 20:47:05 +08:00
|
|
|
- name: Setup CNI
|
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "/etc/cni/net.d/{{ item }}"
|
|
|
|
owner: root
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2022-10-19 20:47:05 +08:00
|
|
|
with_items:
|
|
|
|
- 10-mynet.conf
|