From de9280fd5e4fa9172b89619e75ce20b4d685c01e Mon Sep 17 00:00:00 2001 From: YuruC3 <98943911+YuruC3@@users.noreply.github.com> Date: Mon, 12 May 2025 00:01:30 +0200 Subject: [PATCH] Some rough templates --- galeraDeploy.vars.yaml | 3 +++ galeraDeploy.yaml | 57 +++++++++++++++++++++++++++++++++++++++++ loadBalancers.vars.yaml | 3 +++ loadBalancers.yaml | 53 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 galeraDeploy.vars.yaml create mode 100644 galeraDeploy.yaml create mode 100644 loadBalancers.vars.yaml create mode 100644 loadBalancers.yaml diff --git a/galeraDeploy.vars.yaml b/galeraDeploy.vars.yaml new file mode 100644 index 0000000..95d27cc --- /dev/null +++ b/galeraDeploy.vars.yaml @@ -0,0 +1,3 @@ +--- +vars1: "1" +vars2: "2" \ No newline at end of file diff --git a/galeraDeploy.yaml b/galeraDeploy.yaml new file mode 100644 index 0000000..ad15ffa --- /dev/null +++ b/galeraDeploy.yaml @@ -0,0 +1,57 @@ +--- +- name: Install galera cluster + + hosts: 1.2.3.4 + become: yes + gather_facts: yes + vars_files: + - galeraDeploy.vars.yaml + + pre_tasks: + - name: update + apt: + upgrade: no + update_cache: yes + cache_valid_time: 14400 #4h + + - name: upgrade + apt: + upgrade: yes + + - name: apt dist-upgrade + apt: + upgrade: dist + + - name: remove hanging packages and clean repos + apt: + autoremove: true + autoclean: true + + tasks: + - name: Install dependencies + apt: + state: present + name: + - wget + - curl + - mariadb-server + - mariadb-client + - galera-4 + + + + - name: template to copy from + apt: + state: brainrot + set_fact: + wazuh_agent_name: "{{ ansible_hostname }}" + environment: + WAZUH_AGENT_GROUP: "{{ wazuh_agent_groups }}" + WAZUH_MANAGER: "{{ wazuh_manager_ip }}" + WAZUH_AGENT_NAME: "{{ wazuh_agent_name }}" + + + + # bootstarp on first node + # galera_new_cluster + diff --git a/loadBalancers.vars.yaml b/loadBalancers.vars.yaml new file mode 100644 index 0000000..95d27cc --- /dev/null +++ b/loadBalancers.vars.yaml @@ -0,0 +1,3 @@ +--- +vars1: "1" +vars2: "2" \ No newline at end of file diff --git a/loadBalancers.yaml b/loadBalancers.yaml new file mode 100644 index 0000000..27ae90e --- /dev/null +++ b/loadBalancers.yaml @@ -0,0 +1,53 @@ +--- +- name: Install LB for galera cluster + + hosts: 1.2.3.4 + become: yes + gather_facts: yes + vars_files: + - loadBalancers.vars.yaml + + pre_tasks: + - name: update + apt: + upgrade: no + update_cache: yes + cache_valid_time: 14400 #4h + + - name: upgrade + apt: + upgrade: yes + + - name: apt dist-upgrade + apt: + upgrade: dist + + - name: remove hanging packages and clean repos + apt: + autoremove: true + autoclean: true + + tasks: + - name: Install dependencies + apt: + state: present + name: + - wget + - curl + - keepalived + - haproxy + + + - name: template to copy from + apt: + state: brainrot + environment: + WAZUH_AGENT_GROUP: "{{ wazuh_agent_groups }}" + WAZUH_MANAGER: "{{ wazuh_manager_ip }}" + WAZUH_AGENT_NAME: "{{ wazuh_agent_name }}" + + + + # bootstarp on first node + # galera_new_cluster +