- name: Set hostname in write_graphite.conf
replace:
- path: "/etc/collectd.d/write_graphite.conf"
+ dest: "/etc/collectd.d/write_graphite.conf"
regexp: 'Host ".*"'
replace: "Host \"{{ groups['ceph-grafana'][0] }}\""
notify: Restart collectd
- name: Set cluster name in cephmetrics.conf
replace:
- path: /etc/collectd.d/cephmetrics.conf
+ dest: /etc/collectd.d/cephmetrics.conf
regexp: 'ClusterName ".*"'
replace: 'ClusterName "{{ cluster }}"'
notify: Restart collectd
---
- name: Configure retention for collectd stats
blockinfile:
- path: /etc/carbon/storage-schemas.conf
+ dest: /etc/carbon/storage-schemas.conf
# NOTE: Retention settings are applied to metrics as they are *created*. If
# these settings are changed after-the-fact, it's necessary to either
# delete the whisper files (!) or run whisper-resize on them all.
- name: Set domain in grafana.ini
lineinfile:
- path: /etc/grafana/grafana.ini
+ dest: /etc/grafana/grafana.ini
regexp: "^domain = .*"
insertafter: "^;domain = .*"
line: "domain = {{ ansible_fqdn }}"
- name: Set root_url in grafana.ini
lineinfile:
- path: /etc/grafana/grafana.ini
+ dest: /etc/grafana/grafana.ini
regexp: "^root_url = .*"
insertafter: "^;root_url = .*"
line: "root_url = %(protocol)s://%(domain)s:3000"
- name: Set VirtualHost port in graphite httpd config
replace:
- path: /etc/httpd/conf.d/graphite-web.conf
+ dest: /etc/httpd/conf.d/graphite-web.conf
regexp: "^<VirtualHost \\*:.+>$"
replace: "<VirtualHost *:{{ graphite.port }}>"
notify: Restart graphite-web