diff --git a/roles/grafana/files/Ubuntu-18-override.conf b/roles/grafana/files/Ubuntu-18-override.conf new file mode 100644 index 0000000..fd7e440 --- /dev/null +++ b/roles/grafana/files/Ubuntu-18-override.conf @@ -0,0 +1,10 @@ +[Service] +SystemCallFilter= +SystemCallFilter=~@privileged +SystemCallFilter=~@resources + +ProcSubset= +ProtectClock= +ProtectHostname= +ProtectKernelLogs= +ProtectProc= diff --git a/roles/grafana/tasks/Ubuntu-18.yaml b/roles/grafana/tasks/Ubuntu-18.yaml new file mode 100644 index 0000000..d68fe2e --- /dev/null +++ b/roles/grafana/tasks/Ubuntu-18.yaml @@ -0,0 +1,19 @@ +--- +- name: create grafana-server.service.d + file: + path: /etc/systemd/system/grafana-server.service.d + owner: root + group: root + mode: 0755 + state: directory + +- name: configure systemd override + copy: + src: Ubuntu-18-override.conf + dest: /etc/systemd/system/grafana-server.service.d/10-override.conf + owner: root + group: root + mode: 0644 + notify: + - grafana daemon-reload + - restart grafana diff --git a/roles/grafana/tasks/main.yaml b/roles/grafana/tasks/main.yaml index 6aacd42..1f0a5a4 100644 --- a/roles/grafana/tasks/main.yaml +++ b/roles/grafana/tasks/main.yaml @@ -4,7 +4,7 @@ vars: possible_files: files: - - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" - "{{ ansible_os_family }}.yaml" - "default.yaml" @@ -16,8 +16,17 @@ vars: possible_files: files: - - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" + - "default.yaml" + paths: + - tasks + +- name: include os family specific tasks + include_tasks: "{{ lookup('first_found', possible_files) }}" + vars: + possible_files: + files: - "{{ ansible_os_family }}.yaml" - "default.yaml" paths: