Compare commits

..

No commits in common. "20dd1f1018eaade1d6f4033659ddd3794ff9cae2" and "e7602bd91076d658f6f32304b024d745b40c8be1" have entirely different histories.

7 changed files with 22 additions and 24 deletions

View File

@ -1,2 +0,0 @@
skip_list:
- name[casing]

View File

@ -1,11 +1,11 @@
--- ---
grafana_package_version: grafana_package_version:
grafana_package_name: "grafana{{ grafana_package_version }}" grafana_package_name: "grafana{{grafana_package_version}}"
grafana_package_state: present grafana_package_state: present
grafana_service_name: grafana-server.service grafana_service_name: grafana-server.service
grafana_service_state: started grafana_service_state: started
grafana_service_enabled: true grafana_service_enabled: yes
grafana_etc_path: /etc/grafana grafana_etc_path: /etc/grafana
grafana_config_path: "{{ grafana_etc_path }}/grafana.ini" grafana_config_path: "{{ grafana_etc_path }}/grafana.ini"
@ -23,10 +23,10 @@ grafana_config:
http_addr: localhost http_addr: localhost
http_port: "{{ grafana_port }}" http_port: "{{ grafana_port }}"
grafana_ssl_enabled: true grafana_ssl_enabled: yes
grafana_ssl_certificate: "/etc/letsencrypt/live/{{ grafana_domain }}/fullchain.pem" grafana_ssl_certificate: "/etc/letsencrypt/live/{{ grafana_domain }}/fullchain.pem"
grafana_ssl_certificate_key: "/etc/letsencrypt/live/{{ grafana_domain }}/privkey.pem" grafana_ssl_certificate_key: "/etc/letsencrypt/live/{{ grafana_domain }}/privkey.pem"
# grafana_ssl_dhparam: "/etc/letsencrypt/ssl-dhparams.pem" #grafana_ssl_dhparam: "/etc/letsencrypt/ssl-dhparams.pem"
grafana_datasources: grafana_datasources:
apiVersion: 1 apiVersion: 1
@ -36,7 +36,7 @@ grafana_datasources:
access: proxy access: proxy
url: http://localhost:8086 url: http://localhost:8086
database: telegraf database: telegraf
isDefault: true isDefault: yes
version: 1 version: 1
grafana_dashboards: grafana_dashboards:

View File

@ -1,11 +1,11 @@
--- ---
- name: grafana daemon-reload - name: grafana daemon-reload
ansible.builtin.systemd: systemd:
name: "{{ grafana_service_name }}" name: "{{ grafana_service_name }}"
daemon_reload: true daemon_reload: yes
state: restarted state: restarted
- name: restart grafana - name: restart grafana
ansible.builtin.service: service:
name: "{{ grafana_service_name }}" name: "{{ grafana_service_name }}"
state: restarted state: restarted

View File

@ -1,12 +1,12 @@
--- ---
- name: add grafana apt key - name: add grafana apt key
ansible.builtin.apt_key: apt_key:
url: https://packages.grafana.com/gpg.key url: https://packages.grafana.com/gpg.key
state: present state: present
- name: configure apt repository - name: configure apt repository
ansible.builtin.apt_repository: apt_repository:
repo: "deb https://packages.grafana.com/oss/deb stable main" repo: "deb https://packages.grafana.com/oss/deb stable main"
filename: grafana filename: grafana
update_cache: true update_cache: yes
state: present state: present

View File

@ -1,6 +1,6 @@
--- ---
- name: create grafana-server.service.d - name: create grafana-server.service.d
ansible.builtin.file: file:
path: /etc/systemd/system/grafana-server.service.d path: /etc/systemd/system/grafana-server.service.d
owner: root owner: root
group: root group: root
@ -8,7 +8,7 @@
state: directory state: directory
- name: configure systemd override - name: configure systemd override
ansible.builtin.copy: copy:
src: Ubuntu-18-override.conf src: Ubuntu-18-override.conf
dest: /etc/systemd/system/grafana-server.service.d/10-override.conf dest: /etc/systemd/system/grafana-server.service.d/10-override.conf
owner: root owner: root

View File

@ -33,19 +33,19 @@
- tasks - tasks
- name: install package - name: install package
ansible.builtin.package: package:
name: "{{ grafana_package_name }}" name: "{{ grafana_package_name }}"
state: "{{ grafana_package_state }}" state: "{{ grafana_package_state }}"
- name: "create {{ grafana_etc_path }}" - name: "create {{ grafana_etc_path }}"
ansible.builtin.file: file:
path: "{{ grafana_etc_path }}" path: "{{ grafana_etc_path }}"
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
- name: configure - name: configure
ansible.builtin.template: template:
src: grafana.ini.j2 src: grafana.ini.j2
dest: "{{ grafana_config_path }}" dest: "{{ grafana_config_path }}"
owner: root owner: root
@ -54,7 +54,7 @@
notify: restart grafana notify: restart grafana
- name: provision datasources - name: provision datasources
ansible.builtin.copy: copy:
dest: "{{ grafana_provisioning_path }}/datasources/datasource.yaml" dest: "{{ grafana_provisioning_path }}/datasources/datasource.yaml"
content: "{{ grafana_datasources | to_nice_yaml }}" content: "{{ grafana_datasources | to_nice_yaml }}"
owner: root owner: root
@ -62,7 +62,7 @@
mode: 0640 mode: 0640
- name: create dashboard directory - name: create dashboard directory
ansible.builtin.file: file:
path: /var/lib/grafana/dashboards path: /var/lib/grafana/dashboards
state: directory state: directory
owner: "{{ grafana_user }}" owner: "{{ grafana_user }}"
@ -70,7 +70,7 @@
mode: 0755 mode: 0755
- name: provision dashboards - name: provision dashboards
ansible.builtin.copy: copy:
dest: "{{ grafana_provisioning_path }}/dashboards/dashboards.yaml" dest: "{{ grafana_provisioning_path }}/dashboards/dashboards.yaml"
content: "{{ grafana_dashboards | to_nice_yaml }}" content: "{{ grafana_dashboards | to_nice_yaml }}"
owner: root owner: root
@ -78,7 +78,7 @@
mode: 0640 mode: 0640
- name: upload user dashboards - name: upload user dashboards
ansible.builtin.copy: copy:
src: "files/grafana/dashboards/{{ item }}" src: "files/grafana/dashboards/{{ item }}"
dest: "/var/lib/grafana/dashboards/{{ item | basename }}" dest: "/var/lib/grafana/dashboards/{{ item | basename }}"
owner: "{{ grafana_user }}" owner: "{{ grafana_user }}"
@ -87,7 +87,7 @@
loop: "{{ grafana_dashboard_files | default([]) }}" loop: "{{ grafana_dashboard_files | default([]) }}"
- name: manage service - name: manage service
ansible.builtin.service: service:
name: "{{ grafana_service_name }}" name: "{{ grafana_service_name }}"
state: "{{ grafana_service_state }}" state: "{{ grafana_service_state }}"
enabled: "{{ grafana_service_enabled }}" enabled: "{{ grafana_service_enabled }}"

View File

@ -1,5 +1,5 @@
- name: configure nginx - name: configure nginx
ansible.builtin.template: template:
src: nginx.conf.j2 src: nginx.conf.j2
dest: "{{ nginx_conf_d_path }}/grafana.conf" dest: "{{ nginx_conf_d_path }}/grafana.conf"
owner: root owner: root