techno-tim / k3s-ansible

The easiest way to bootstrap a self-hosted High Availability Kubernetes cluster. A fully automated HA k3s etcd install with kube-vip, MetalLB, and more. Build. Destroy. Repeat.
https://technotim.live/posts/k3s-etcd-ansible/
Apache License 2.0
2.41k stars 1.05k forks source link

Question about extra_args #539

Closed Evantage-WS closed 3 months ago

Evantage-WS commented 3 months ago

Hi,

I am using this collection and it is working very well, thanks.

I am calling your collection from my own playbook with this:

- name: Import the k3s playbook with flannel
  ansible.builtin.import_playbook: "/Users/xxxxx/.ansible/collections/ansible_collections/techno_tim/k3s_ansible/site.yml"
  vars:
    k3s_version: "{{ hostvars['localhost']['k3s_version'] }}"
    k3s_token: "{{ hostvars['localhost']['k3s_token'] }}"
    apiserver_endpoint: "{{ hostvars['localhost']['apiserver_endpoint'] }}"
    k3s_master_taint: "{{ hostvars['localhost']['k3s_master_taint'] }}"
    kube_vip_lb_ip_range: "{{ hostvars['localhost']['kube_vip_lb_ip_range'] }}"
    k3s_cni: "{{ hostvars['localhost']['k3s_cni'] }}"
    install_k3s: "{{ hostvars['localhost']['install_k3s'] }}"
    flannel_iface: "{{ hostvars['localhost']['k8s_interface'] }}"
    extra_args: "--disable local-storage"
  when:
    - install_k3s | default (false) | bool
    - k3s_cni == "flannel"```

and all is working, except the extra_args. Can you tell me how I should have the extra argument stated?
It is failing like this and when I remove the complete extra_args line all is working again.

I have also tried

extra_args: >-
  "--disable local-storage"

and

extra_args: >-
  --disable local-storage

Thanks!

Evantage-WS commented 3 months ago

Found it, this was the fix:

    extra_args:
      - "--disable local-storage"