diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..788482a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +hosts.ini diff --git a/README.md b/README.md index eb45123..e0e617d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Master and nodes must have passwordless SSH access ## Usage -Add the system information gathered above into a file called hosts.ini. For example: +Add the system information gathered above into a file called `hosts.ini` in the same directory as this README file. There is a template in the `inventory` directory. For example: ```bash [master] @@ -35,13 +35,12 @@ Add the system information gathered above into a file called hosts.ini. For exam [k3s_cluster:children] master node - ``` Start provisioning of the cluster using the following command: ```bash -ansible-playbook site.yml -i inventory/hosts.ini +ansible-playbook site.yml ``` ## Kubeconfig @@ -51,4 +50,3 @@ To get access to your **Kubernetes** cluster just ```bash scp debian@master_ip:~/.kube/config ~/.kube/config ``` - diff --git a/roles/raspbian/tasks/main.yml b/roles/raspbian/tasks/main.yml index 3c51075..9fcd127 100644 --- a/roles/raspbian/tasks/main.yml +++ b/roles/raspbian/tasks/main.yml @@ -16,8 +16,32 @@ - ansible_facts.architecture is search("arm") register: boot_cmdline +- name: Flush iptables before changing iptables-legacy + iptables: + flush: true + when: + - ansible_facts.lsb.description is match("[Rr]aspbian.*[Bb]uster") + +- name: Changing to iptables-legacy for Raspbian Buster + alternatives: + path: /usr/sbin/iptables-legacy + name: iptables + register: ip6_legacy + when: + - ansible_facts.lsb.description is match("[Rr]aspbian.*[Bb]uster") + +- name: Changing to ip6tables-legacy for Raspbian Buster + alternatives: + path: /usr/sbin/ip6tables-legacy + name: ip6tables + register: ip4_legacy + when: + - ansible_facts.lsb.description is match("[Rr]aspbian.*[Bb]uster") + - name: Rebooting on Raspbian reboot: when: - boot_cmdline is changed - ansible_facts.architecture is search("arm") + - ip6_legacy is changed + - ip4_legacy is changed