From 7cb78be4878508704b949e02c010f8a9b2cc02ce Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 08:20:05 +0100 Subject: [PATCH] 111 --- playbooks/00_initial_adjustments.yml | 32 +++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/playbooks/00_initial_adjustments.yml b/playbooks/00_initial_adjustments.yml index 3cfc165..ece1648 100644 --- a/playbooks/00_initial_adjustments.yml +++ b/playbooks/00_initial_adjustments.yml @@ -8,6 +8,7 @@ - name: Debug ansible.builtin.debug: msg: "{{ ansible_default_ipv4.interface }}" + - name: Reconfigure /root/.bashrc ansible.builtin.lineinfile: path: /root/.bashrc @@ -16,20 +17,21 @@ 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: 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 -%} + when: "{{ ansible_default_ipv4.interface }}" == "eth0" - name: Set a hostname ansible.builtin.hostname: name: >- @@ -44,7 +46,7 @@ {%- elif ansible_end0.macaddress == "00:1e:06:48:b3:0c" -%} odroidc4-5 {%- endif -%} - + when: "{{ ansible_default_ipv4.interface }}" == "end0" - name: Iptables 1 ansible.builtin.command: iptables -F