From 234e986effe2029abdb413e161250e7ea2135801 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Fri, 24 Jun 2022 20:38:52 +0200 Subject: [PATCH] Holyday tmp --- .gitmodules | 3 +++ Makefile | 2 +- inventory/group_vars/all.yml | 10 ++++++++-- inventory/hosts.yml | 21 +++++++++++++++------ node-configuration/tasks/misc.yml | 5 +++++ postgresql_cluster | 1 + 6 files changed, 33 insertions(+), 9 deletions(-) create mode 160000 postgresql_cluster diff --git a/.gitmodules b/.gitmodules index c4166f1..f73ed5a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "k3s-ansible"] path = k3s-ansible url = https://github.com/k3s-io/k3s-ansible +[submodule "postgresql_cluster"] + path = postgresql_cluster + url = https://github.com/vitabaks/postgresql_cluster.git diff --git a/Makefile b/Makefile index 1392422..bbbda49 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: setup k3s wg +all: setup wg k3s setup: ansible-playbook -i "inventory/hosts.yml" "init.yml" diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index b95f898..05b780e 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -3,5 +3,11 @@ k3s_version: v1.23.6+k3s1 # ansible_user: debian systemd_dir: /etc/systemd/system master_ip: "{{ hostvars[groups['master'][0]]['wireguard_ip'] | default(groups['master'][0]) }}" -extra_server_args: "--no-deploy traefik --advertise-address {{hostvars[inventory_hostname]['wireguard_ip']}}" -extra_agent_args: "" +extra_server_args: "--no-deploy traefik --advertise-address {{hostvars[inventory_hostname]['wireguard_ip']}} --flannel-iface wg0 --tls-san {{ ansible_host }}" +extra_agent_args: "--flannel-iface wg0 --node-external-ip {{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}" + +cluster_vip: "10.20.0.2" +patroni_cluster_name: "postgres-cluster" +with_haproxy_load_balancing: false +postgresql_version: "14" +postgresql_data_dir: "/var/lib/postgresql/{{ postgresql_version }}/{{ postgresql_cluster_name }}" diff --git a/inventory/hosts.yml b/inventory/hosts.yml index 0c6a65d..ac76f29 100644 --- a/inventory/hosts.yml +++ b/inventory/hosts.yml @@ -6,15 +6,10 @@ all: hostname: cp wireguard_ip: 10.20.0.2 outsider: - ansible_host: 51.15.109.2 + ansible_host: 51.15.60.240 is_nas: false hostname: outsider wireguard_ip: 10.20.0.1 - local: - ansible_connection: local - ansible_host: 127.0.0.1 - is_local: true - wireguard_ip: 10.20.0.3 children: master: hosts: @@ -22,6 +17,20 @@ all: node: hosts: outsider: + etcd_cluster: + hosts: + cp: + outsider: + master: + hosts: + cp: + replica: + hosts: + outsider: + postgres_cluster: + children: + master: + replica: k3s_cluster: children: master: diff --git a/node-configuration/tasks/misc.yml b/node-configuration/tasks/misc.yml index af8c33a..11c1d76 100644 --- a/node-configuration/tasks/misc.yml +++ b/node-configuration/tasks/misc.yml @@ -20,3 +20,8 @@ ansible.builtin.hostname: name: "{{ hostname }}" when: hostname is defined + +- name: Install open-iscsi + ansible.builtin.package: + name: open-iscsi + state: present diff --git a/postgresql_cluster b/postgresql_cluster new file mode 160000 index 0000000..d5c67c8 --- /dev/null +++ b/postgresql_cluster @@ -0,0 +1 @@ +Subproject commit d5c67c8422bdf8fcf00f2ab66135945e9dfba5fd