Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix grafana playbook #1296

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions grafana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- name: Install Dependencies
become: true
ansible.builtin.package:
name: ['python3-virtualenv']
name: ['python3-virtualenv', 'python3-docker']
- name: Ensure git is installed. (hxr.monitor-ssl)
become: true
ansible.builtin.package:
Expand All @@ -43,6 +43,7 @@
ansible.posix.mount:
path: /data
src: /dev/vdb
fstype: xfs
state: mounted
become: true

Expand Down Expand Up @@ -75,6 +76,8 @@
## Grafana
- role: galaxyproject.nginx
become: true
vars:
hostname: "{{ grafana_domain }}"
- grafana
- role: pgs
become: true
Expand Down Expand Up @@ -106,13 +109,15 @@
state: directory
owner: "{{ ansible_ssh_user }}"
group: "{{ ansible_ssh_user }}"
mode: "0755"
become: true
- name: Get docker compose
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/grafana/oncall/49d20f1a7e40669e901db95443603138e1a1cde4/docker-compose.yml
dest: "{{ grafana_on_call_path }}/docker_compose.yml"
dest: "{{ grafana_on_call_path }}/docker-compose.yml"
owner: "{{ ansible_ssh_user }}"
group: "{{ ansible_ssh_user }}"
mode: "0600"
- name: Create env
copy:
content: |
Expand All @@ -125,12 +130,12 @@
mode: "0600"
no_log: true
- name: Spin up OnCall
docker_compose:
community.general.docker_compose:
project_src: "{{ grafana_on_call_path }}"
register: output
- name: Run `docker-compose up` again
docker_compose:
- name: Remove OnCall
when: not grafana_on_call
block:
- name: Stop all services
community.general.docker_compose:
project_src: "{{ grafana_on_call_path }}"
register: output
- assert:
that: "not output.changed "
state: absent
4 changes: 3 additions & 1 deletion group_vars/grafana/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ certbot_virtualenv_command: virtualenv-3.6
certbot_virtualenv_package_name: python3-virtualenv
certbot_post_renewal: |
systemctl restart nginx || true

#hostname: "{{ grafana_domain }}"
# NGINX
nginx_enable_default_server: false
nginx_servers:
Expand All @@ -34,6 +34,8 @@ nginx_ssl_role: usegalaxy-eu.certbot
nginx_conf_ssl_certificate: /etc/ssl/certs/fullchain.pem
nginx_conf_ssl_certificate_key: /etc/ssl/user/privkey-nginx.pem

#setting this to false will remove the on call compose services and it's compose directory
grafana_on_call: false
# Grafana
grafana_version: 11.0.0

Expand Down
Loading