onedr0p / k3s-homeops-ansible

Bootstrap a k3s cluster on top of Ubuntu 20.04
54 stars 5 forks source link

Convert Calico BGP file to inline with EOF #17

Closed carpenike closed 4 years ago

carpenike commented 4 years ago

Getting errors because it references a local path that is no longer local.

failed: [k3s-0 -> localhost] (item=kubectl apply -f /home/ryan/src/k3s-bootstrap/devops/kube-system/calico/calico.yaml) => {"ansible_loop_var": "item", "attempts": 6, "changed": false, "cmd": ["kubectl", "apply", "-f", "/home/ryan/src/k3s-bootstrap/devops/kube-system/calico/calico.yaml"], "delta": "0:00:00.239140", "end": "2020-02-17 00:55:58.162550", "item": "kubectl apply -f /home/ryan/src/k3s-bootstrap/devops/kube-system/calico/calico.yaml", "msg": "non-zero return code", "rc": 1, "start": "2020-02-17 00:55:57.923410", "stderr": "Unable to connect to the server: x509: certificate signed by unknown authority", "stderr_lines": ["Unable to connect to the server: x509: certificate signed by unknown authority"], "stdout": "", "stdout_lines": []}

carpenike commented 4 years ago

File where error occurs:

https://github.com/carpenike/k3s-bootstrap/blob/master/ansible/roles/k3s/master/tasks/calico.yml#L8

Alternatively just update the variable with a raw link to a raw path

carpenike commented 4 years ago

@onedr0p thinking about replacing the script call with an inline yaml and use variable substation for the BGP peer. It’s a pretty simple config. What are your thoughts?

onedr0p commented 4 years ago

Did you do this substitution here? https://github.com/carpenike/k3s-bootstrap/blob/master/ansible/roles/k3s/master/tasks/calico.yml#L22

Feels alright!

carpenike commented 4 years ago

Yup! Reduces a dependency on an external file and it’s a small enough add that it doesn’t make the file look bad. Did a similar thing for the vault write policy.

carpenike commented 4 years ago

/closed. this is completed