From 20fb7aeacfe9585bfc74940dabb16639954c7391 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Sat, 19 Aug 2023 17:29:54 +0000 Subject: [PATCH] Add prometheus hosts --- group_vars/prometheus.yml | 8 ++++++++ host_vars/prometheus02.home.foo.sh.yml | 6 ++++++ hosts.yml | 4 ++++ playbooks/prometheus.yml | 28 ++++++++++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 group_vars/prometheus.yml create mode 100644 host_vars/prometheus02.home.foo.sh.yml create mode 100644 playbooks/prometheus.yml diff --git a/group_vars/prometheus.yml b/group_vars/prometheus.yml new file mode 100644 index 0000000..e80e98c --- /dev/null +++ b/group_vars/prometheus.yml @@ -0,0 +1,8 @@ +--- +datadisks: + - {size: 10, type: nvme} + +firewall_in: + - {proto: tcp, port: 22, from: [172.20.20.0/22]} + - {proto: tcp, port: 443, from: [172.20.20.0/22]} + - {proto: tcp, port: 9100, from: [172.20.20.0/22]} diff --git a/host_vars/prometheus02.home.foo.sh.yml b/host_vars/prometheus02.home.foo.sh.yml new file mode 100644 index 0000000..6c7cc03 --- /dev/null +++ b/host_vars/prometheus02.home.foo.sh.yml @@ -0,0 +1,6 @@ +--- +vmhost: vmhost02.home.foo.sh +network_interfaces: + - device: eth0 + vlan: 20 + mac: "52:54:00:ac:dc:84" diff --git a/hosts.yml b/hosts.yml index fe4345c..7c55f68 100644 --- a/hosts.yml +++ b/hosts.yml @@ -84,6 +84,9 @@ ocinode: print: hosts: print01.home.foo.sh: +prometheus: + hosts: + prometheus02.home.foo.sh: proxy: hosts: proxy01.home.foo.sh: @@ -154,6 +157,7 @@ rocky9: ldap: mirror: mongodb: + prometheus: sqldb: static: vmhost: diff --git a/playbooks/prometheus.yml b/playbooks/prometheus.yml new file mode 100644 index 0000000..bec40ff --- /dev/null +++ b/playbooks/prometheus.yml @@ -0,0 +1,28 @@ +--- +- name: Deploy KVM virtual machines + ansible.builtin.import_playbook: include/deploy-kvm-guest.yml + vars: + myhosts: prometheus + +- name: Configure instance + hosts: prometheus + user: root + gather_facts: true + + vars_files: + - "{{ ansible_private }}/vars.yml" + + pre_tasks: + - name: Mount /export + ansible.posix.mount: + name: /export + src: LABEL=/export + fstype: xfs + opts: noatime,noexec,nosuid,nodev + passno: "0" + dump: "0" + state: mounted + + roles: + - base + - prometheus