From 329fb10ef8634c6370cebee86fcfd1dd006aa9c6 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sat, 18 May 2024 17:02:58 +0200 Subject: [PATCH] refactor hosts example file as a test inventory directory Signed-off-by: Markus Katharina Brechtel --- ansible/hosts.yaml.example | 110 ----------------------- test/inventory/group_vars/all.yaml | 6 ++ test/inventory/group_vars/baremetal.yaml | 43 +++++++++ test/inventory/host_vars/server01.yaml | 12 +++ test/inventory/host_vars/server02.yaml | 12 +++ test/inventory/host_vars/server03.yaml | 12 +++ test/inventory/host_vars/server04.yaml | 7 ++ test/inventory/host_vars/server05.yaml | 7 ++ test/inventory/hosts.ini | 6 ++ 9 files changed, 105 insertions(+), 110 deletions(-) delete mode 100644 ansible/hosts.yaml.example create mode 100644 test/inventory/group_vars/all.yaml create mode 100644 test/inventory/group_vars/baremetal.yaml create mode 100644 test/inventory/host_vars/server01.yaml create mode 100644 test/inventory/host_vars/server02.yaml create mode 100644 test/inventory/host_vars/server03.yaml create mode 100644 test/inventory/host_vars/server04.yaml create mode 100644 test/inventory/host_vars/server05.yaml create mode 100644 test/inventory/hosts.ini diff --git a/ansible/hosts.yaml.example b/ansible/hosts.yaml.example deleted file mode 100644 index 06f7210..0000000 --- a/ansible/hosts.yaml.example +++ /dev/null @@ -1,110 +0,0 @@ -all: - vars: - ceph_fsid: "e2850e1f-7aab-472e-b6b1-824e19a75071" - ceph_rbd_cache: "2048Mi" - ceph_rbd_cache_max: "1792Mi" - ceph_rbd_cache_target: "1536Mi" - incus_name: "baremetal" - ovn_name: "baremetal" - children: - baremetal: - vars: - ansible_connection: incus - ansible_incus_remote: local - ansible_user: root - ansible_become: no - ansible_incus_project: dev-incus-deploy - ceph_roles: - - client - - osd - incus_roles: - - cluster - - ui - incus_init: - network: - LOCAL: - type: macvlan - local_config: - parent: enp5s0 - UPLINK: - type: physical - config: - ipv4.gateway: "172.31.254.1/24" - ipv6.gateway: "fd00:1e4d:637d:1234::1/64" - ipv4.ovn.ranges: "172.31.254.10-172.31.254.254" - dns.nameservers: "1.1.1.1,1.0.0.1" - local_config: - parent: enp6s0 - default: - type: ovn - config: - network: UPLINK - default: true - storage: - local: - driver: zfs - local_config: - source: "/dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_incus_disk3" - remote: - driver: ceph - local_config: - source: "incus_{{ incus_name }}" - default: true - ovn_roles: - - host - hosts: - server01: - ceph_roles: - - client - - mon - - mds - - mgr - - osd - ceph_disks: - - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 - - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 - ovn_roles: - - central - - host - server02: - ceph_roles: - - client - - mon - - mds - - mgr - - osd - ceph_disks: - - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 - - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 - ovn_roles: - - central - - host - server03: - ceph_roles: - - client - - mon - - mds - - mgr - - osd - ceph_disks: - - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 - - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 - ovn_roles: - - central - - host - server04: - ceph_disks: - - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 - - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 - ceph_roles: - - client - - osd - - rgw - server05: - ceph_disks: - - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 - - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 - ceph_roles: - - client - - osd - - rgw diff --git a/test/inventory/group_vars/all.yaml b/test/inventory/group_vars/all.yaml new file mode 100644 index 0000000..a96be9d --- /dev/null +++ b/test/inventory/group_vars/all.yaml @@ -0,0 +1,6 @@ +ceph_fsid: "e2850e1f-7aab-472e-b6b1-824e19a75071" +ceph_rbd_cache: "2048Mi" +ceph_rbd_cache_max: "1792Mi" +ceph_rbd_cache_target: "1536Mi" +incus_name: "baremetal" +ovn_name: "baremetal" diff --git a/test/inventory/group_vars/baremetal.yaml b/test/inventory/group_vars/baremetal.yaml new file mode 100644 index 0000000..1fa0e12 --- /dev/null +++ b/test/inventory/group_vars/baremetal.yaml @@ -0,0 +1,43 @@ +ansible_connection: incus +ansible_incus_remote: local +ansible_user: root +ansible_become: no +ansible_incus_project: dev-incus-deploy +ceph_roles: + - client + - osd +incus_roles: + - cluster + - ui +incus_init: + network: + LOCAL: + type: macvlan + local_config: + parent: enp5s0 + UPLINK: + type: physical + config: + ipv4.gateway: "172.31.254.1/24" + ipv6.gateway: "fd00:1e4d:637d:1234::1/64" + ipv4.ovn.ranges: "172.31.254.10-172.31.254.254" + dns.nameservers: "1.1.1.1,1.0.0.1" + local_config: + parent: enp6s0 + default: + type: ovn + config: + network: UPLINK + default: true + storage: + local: + driver: zfs + local_config: + source: "/dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_incus_disk3" + remote: + driver: ceph + local_config: + source: "incus_{{ incus_name }}" + default: true +ovn_roles: + - host diff --git a/test/inventory/host_vars/server01.yaml b/test/inventory/host_vars/server01.yaml new file mode 100644 index 0000000..0eba541 --- /dev/null +++ b/test/inventory/host_vars/server01.yaml @@ -0,0 +1,12 @@ +ceph_roles: + - client + - mon + - mds + - mgr + - osd +ceph_disks: + - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 + - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 +ovn_roles: + - central + - host diff --git a/test/inventory/host_vars/server02.yaml b/test/inventory/host_vars/server02.yaml new file mode 100644 index 0000000..0eba541 --- /dev/null +++ b/test/inventory/host_vars/server02.yaml @@ -0,0 +1,12 @@ +ceph_roles: + - client + - mon + - mds + - mgr + - osd +ceph_disks: + - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 + - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 +ovn_roles: + - central + - host diff --git a/test/inventory/host_vars/server03.yaml b/test/inventory/host_vars/server03.yaml new file mode 100644 index 0000000..0eba541 --- /dev/null +++ b/test/inventory/host_vars/server03.yaml @@ -0,0 +1,12 @@ +ceph_roles: + - client + - mon + - mds + - mgr + - osd +ceph_disks: + - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 + - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 +ovn_roles: + - central + - host diff --git a/test/inventory/host_vars/server04.yaml b/test/inventory/host_vars/server04.yaml new file mode 100644 index 0000000..d6970bc --- /dev/null +++ b/test/inventory/host_vars/server04.yaml @@ -0,0 +1,7 @@ +ceph_disks: + - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 + - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 +ceph_roles: + - client + - osd + - rgw diff --git a/test/inventory/host_vars/server05.yaml b/test/inventory/host_vars/server05.yaml new file mode 100644 index 0000000..d6970bc --- /dev/null +++ b/test/inventory/host_vars/server05.yaml @@ -0,0 +1,7 @@ +ceph_disks: + - data: nvme-QEMU_NVMe_Ctrl_incus_disk1 + - data: nvme-QEMU_NVMe_Ctrl_incus_disk2 +ceph_roles: + - client + - osd + - rgw diff --git a/test/inventory/hosts.ini b/test/inventory/hosts.ini new file mode 100644 index 0000000..9d59b9d --- /dev/null +++ b/test/inventory/hosts.ini @@ -0,0 +1,6 @@ +[baremetal] +server01 +server02 +server03 +server04 +server05