diff --git a/ansible/playbooks/requirements.yml b/ansible/playbooks/requirements.yml new file mode 100644 index 0000000..7d137c5 --- /dev/null +++ b/ansible/playbooks/requirements.yml @@ -0,0 +1,11 @@ +--- +collections: + - freeipa.ansible_freeipa + - community.general + - ansible.posix + + +roles: + - name: geerlingguy.mysql + - name: cloudalchemy.prometheus + - name: cloudalchemy.node-exporter diff --git a/ansible/playbooks/role-rocky-monitoring.yml b/ansible/playbooks/role-rocky-monitoring.yml new file mode 100644 index 0000000..9ea70ed --- /dev/null +++ b/ansible/playbooks/role-rocky-monitoring.yml @@ -0,0 +1,32 @@ +--- +# Creates the first monitoring server +# Reccommended specs +# CPU: 2 cores +# Memory: 2GB +# Storage: a piece of string +- name: Install Prometheus + hosts: monitoringserver + become: true + + pre_tasks: + - name: Verify if we can run ansible + assert: + that: + - "not no_ansible.stat.exists" + msg: "/etc/no-ansible exists - skipping run on this node" + - name: Install SELinux packages + package: + name: python3-policycoreutils.noarch + state: latest + + role: + - role: cloudalchemy.prometheus + + post_tasks: + - name: Touching run file that ansible has ran here + file: + path: /var/log/ansible.run + state: touch + mode: '0644' + owner: root + group: root diff --git a/ansible/playbooks/vars/monitoring.yml b/ansible/playbooks/vars/monitoring.yml new file mode 100644 index 0000000..e4c1e77 --- /dev/null +++ b/ansible/playbooks/vars/monitoring.yml @@ -0,0 +1,8 @@ +--- +#prometheus_targets: +# node: +# - targets: +# - host1 +# - host2 +# labels: +# env: production diff --git a/ansible/roles/requirements.yml b/ansible/roles/requirements.yml index f796222..c1d5195 100644 --- a/ansible/roles/requirements.yml +++ b/ansible/roles/requirements.yml @@ -2,6 +2,9 @@ roles: - name: geerlingguy.mysql + # monitoring + - name: cloudalchemy.node-exporter + - name: cloudalchemy.prometheus collections: # freeipa