From 5b258eba7a412c17f21542146131663cace1e322 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Thu, 25 Nov 2021 18:48:31 +0700 Subject: [PATCH] style(metal): convert inventories from YAML to INI We don't need to parse the inventories in Terraform anymore. INI is easier to read and edit --- metal/Makefile | 8 ++++---- metal/inventories/dev.ini | 8 ++++++++ metal/inventories/dev.yml | 5 ----- metal/inventories/prod.ini | 11 +++++++++++ metal/inventories/prod.yml | 10 ---------- 5 files changed, 23 insertions(+), 19 deletions(-) create mode 100644 metal/inventories/dev.ini delete mode 100644 metal/inventories/dev.yml create mode 100644 metal/inventories/prod.ini delete mode 100644 metal/inventories/prod.yml diff --git a/metal/Makefile b/metal/Makefile index 167e3019..c018adb0 100644 --- a/metal/Makefile +++ b/metal/Makefile @@ -4,17 +4,17 @@ default: boot cluster boot: ansible-playbook \ - --inventory inventories/prod.yml \ + --inventory inventories/prod.ini \ main.yml cluster: ansible-playbook \ - --inventory inventories/prod.yml \ + --inventory inventories/prod.ini \ cluster.yml shutdown: ansible-playbook \ - --inventory inventories/prod.yml \ + --inventory inventories/prod.ini \ shutdown.yml lint: @@ -23,5 +23,5 @@ lint: dev: vagrant up ansible-playbook \ - --inventory inventories/dev.yml \ + --inventory inventories/dev.ini \ cluster.yml diff --git a/metal/inventories/dev.ini b/metal/inventories/dev.ini new file mode 100644 index 00000000..5f4bf875 --- /dev/null +++ b/metal/inventories/dev.ini @@ -0,0 +1,8 @@ +[metal:children] +masters +workers + +[masters] +dev0 ansible_host=192.168.56.101 + +[workers] diff --git a/metal/inventories/dev.yml b/metal/inventories/dev.yml deleted file mode 100644 index 484237d2..00000000 --- a/metal/inventories/dev.yml +++ /dev/null @@ -1,5 +0,0 @@ -metal: - children: - masters: - hosts: - dev0: {ansible_host: 192.168.56.101} diff --git a/metal/inventories/prod.ini b/metal/inventories/prod.ini new file mode 100644 index 00000000..4d919af1 --- /dev/null +++ b/metal/inventories/prod.ini @@ -0,0 +1,11 @@ +[metal:children] +masters +workers + +[masters] +metal0 ansible_host=192.168.1.110 mac='00:23:24:d1:f3:f0' +metal1 ansible_host=192.168.1.111 mac='00:23:24:d1:f4:d6' +metal2 ansible_host=192.168.1.112 mac='00:23:24:e7:04:60' + +[workers] +metal3 ansible_host=192.168.1.113 mac='00:23:24:d1:f5:69' diff --git a/metal/inventories/prod.yml b/metal/inventories/prod.yml deleted file mode 100644 index 3a37c7b7..00000000 --- a/metal/inventories/prod.yml +++ /dev/null @@ -1,10 +0,0 @@ -metal: - children: - masters: - hosts: - metal0: {ansible_host: 192.168.1.110, mac: '00:23:24:d1:f3:f0'} - metal1: {ansible_host: 192.168.1.111, mac: '00:23:24:d1:f4:d6'} - metal2: {ansible_host: 192.168.1.112, mac: '00:23:24:e7:04:60'} - workers: - hosts: - metal3: {ansible_host: 192.168.1.113, mac: '00:23:24:d1:f5:69'}