Go-based network automation with YANG models, gRPC, Ansible, Terraform, and Kubernetes integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
1 KiB
YAML
37 lines
1 KiB
YAML
---
|
|
- name: Download k3s installer
|
|
ansible.builtin.get_url:
|
|
url: https://get.k3s.io
|
|
dest: /tmp/k3s-install.sh
|
|
mode: "0755"
|
|
|
|
- name: Install k3s
|
|
ansible.builtin.command:
|
|
cmd: /tmp/k3s-install.sh
|
|
creates: /usr/local/bin/k3s
|
|
environment:
|
|
INSTALL_K3S_VERSION: "{{ k3s_version }}"
|
|
K3S_KUBECONFIG_MODE: "644"
|
|
|
|
- name: Wait for k3s to be ready
|
|
ansible.builtin.command:
|
|
cmd: k3s kubectl get nodes
|
|
register: k3s_nodes
|
|
retries: 10
|
|
delay: 5
|
|
until: k3s_nodes.rc == 0
|
|
|
|
- name: Install Multus CNI
|
|
ansible.builtin.command:
|
|
cmd: k3s kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset-thick.yml
|
|
changed_when: true
|
|
|
|
- name: Create kedge namespace
|
|
ansible.builtin.command:
|
|
cmd: k3s kubectl create namespace kedge --dry-run=client -o yaml | k3s kubectl apply -f -
|
|
changed_when: true
|
|
|
|
- name: Deploy Kedge RBAC
|
|
ansible.builtin.command:
|
|
cmd: k3s kubectl apply -f /opt/kedge/k8s/rbac.yaml
|
|
changed_when: true
|