ansible/playbooks/00_initial_adjustments.yml

42 lines
1.3 KiB
YAML
Raw Normal View History

2022-12-14 02:23:34 +01:00
- hosts: odroid_cluster
2023-10-24 00:11:12 +02:00
name: Initial Adjustments
2022-12-14 02:23:34 +01:00
become: true
2023-10-26 19:19:10 +02:00
gather_facts: no
2023-10-24 00:11:12 +02:00
vars:
iface: "eth0"
2022-12-14 02:23:34 +01:00
tasks:
- 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:
2023-10-23 10:52:53 +02:00
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 -%}
2022-12-14 02:23:34 +01:00
- name: Iptables 1
ansible.builtin.command:
iptables -F
2023-10-24 00:11:12 +02:00
ignore_errors: yes
2022-12-14 02:23:34 +01:00
- name: Iptables 2
ansible.builtin.command:
update-alternatives --set iptables /usr/sbin/iptables-legacy
2023-10-24 00:11:12 +02:00
ignore_errors: yes
2022-12-14 02:23:34 +01:00
- name: Iptables 3
ansible.builtin.command:
2023-10-24 00:11:12 +02:00
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
ignore_errors: yes