Ansible provisionning#217
Conversation
mqasimsarfraz
left a comment
There was a problem hiding this comment.
Overall the playbook looks good but missing ansible tags which is super helpful when running specific tasks.
| path: /var/lib/rancher/k3s/server | ||
| mode: "{{ p.stat.mode }}" | ||
|
|
||
| #- debug: msg="Node TOKEN {{ token }}" |
There was a problem hiding this comment.
How about using ansible tags here with ['never', 'k3s-debug-logs'] this will make sure the task is only executed once you ran the playbook with -e k3s-debug-logs=true.
| owner: root | ||
| group: root | ||
| mode: 755 | ||
| when: ( ansible_facts.userspace_architecture == "x86_64" ) |
There was a problem hiding this comment.
I think it can be done by constructing a dictionary of values and combine all these tasks into one:
binary_map = {
"x86_64": "k3s"
"arm_64": "k3s-arm64"
...
}
There was a problem hiding this comment.
I don't know how to make it work could you pls help me and perhaps make a PR on my repo: https://github.com/itwars/k3s-ansible ?
| group: root | ||
| mode: 0755 | ||
|
|
||
| - name: Enable and check K3s service |
There was a problem hiding this comment.
can we use handler here instead of restarting every time
|
We already have a simple system like this, why bother with ansible? |
Hi,
My proposal is to add a contrib directory. I've done all Ansible stuff to provision a k3s cluster.
Download task is durty because I can' t get k3s version number, so in case of reprovisionning I remove k3s binary and reload it (need to be fixe in future release : #211 ).
For now I've test it with KVM Debian instances. In few days I'll make it happen for ubuntu and Centos.
I wrote setup process for Alpine Linux in README.
Best regards,
Vincent