ansible/playbooks/00_initial_adjustments.yml
2023-10-27 21:15:42 +02:00

48 lines
1.6 KiB
YAML

- hosts: odroid_cluster
name: Initial Adjustments
become: true
gather_facts: no
vars:
iface: "eth0"
tasks:
- name: wait for pods to come up
shell: kubectl get pods -o json -n cattle-system
register: kubectl_get_pods
until: kubectl_get_pods.stdout|from_json|json_query('items[*].status.phase')|unique == ["Running"]
retries: 20
delay: 30
- name: Reconfigure /root/.bashrc
ansible.builtin.lineinfile:
path: /root/.bashrc
line: "export HISTCONTROL=ignoreboth"
- name: Reconfigure /home/jd/.bashrc
ansible.builtin.lineinfile:
path: /home/jd/.bashrc
line: "export HISTCONTROL=ignoreboth"
- name: Set a hostname
ansible.builtin.hostname:
name: >-
{%- if ansible_eth0.macaddress == "00:1e:06:48:cd:8e" -%}
odroidc4-1
{%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:00" -%}
odroidc4-2
{%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:01" -%}
odroidc4-3
{%- elif ansible_eth0.macaddress == "00:1e:06:48:cd:86" -%}
odroidc4-4
{%- elif ansible_eth0.macaddress == "00:1e:06:48:b3:0c" -%}
odroidc4-5
{%- endif -%}
- name: Iptables 1
ansible.builtin.command:
iptables -F
ignore_errors: yes
- name: Iptables 2
ansible.builtin.command:
update-alternatives --set iptables /usr/sbin/iptables-legacy
ignore_errors: yes
- name: Iptables 3
ansible.builtin.command:
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
ignore_errors: yes