Add ansible playbook for indri with prometheus and grafana roles
- Inventory with tailnet hosts (indri, gilbert, sifaka) - Prometheus role: installs via homebrew, templates config from current indri setup - Grafana role: installs via homebrew, starts service - ansible.cfg and requirements.yml for community.general collection - Updated CLAUDE.md with ansible dry-run instructions Tested: ansible-playbook playbooks/indri.yml --check --diff (all ok) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4bb4e37c8f
commit
6823b43745
11 changed files with 106 additions and 0 deletions
3
ansible/roles/grafana/handlers/main.yml
Normal file
3
ansible/roles/grafana/handlers/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
- name: restart grafana
|
||||
ansible.builtin.command: brew services restart grafana
|
||||
11
ansible/roles/grafana/tasks/main.yml
Normal file
11
ansible/roles/grafana/tasks/main.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
- name: Install grafana via homebrew
|
||||
community.general.homebrew:
|
||||
name: grafana
|
||||
state: present
|
||||
|
||||
- name: Ensure grafana service is started
|
||||
ansible.builtin.command: brew services start grafana
|
||||
register: brew_start
|
||||
changed_when: "'Successfully started' in brew_start.stdout"
|
||||
failed_when: false
|
||||
3
ansible/roles/prometheus/handlers/main.yml
Normal file
3
ansible/roles/prometheus/handlers/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
- name: restart prometheus
|
||||
ansible.builtin.command: brew services restart prometheus
|
||||
25
ansible/roles/prometheus/tasks/main.yml
Normal file
25
ansible/roles/prometheus/tasks/main.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- name: Install prometheus via homebrew
|
||||
community.general.homebrew:
|
||||
name: prometheus
|
||||
state: present
|
||||
|
||||
- name: Configure prometheus.yml
|
||||
ansible.builtin.template:
|
||||
src: prometheus.yml.j2
|
||||
dest: /opt/homebrew/etc/prometheus.yml
|
||||
mode: '0644'
|
||||
notify: restart prometheus
|
||||
|
||||
- name: Configure prometheus.args
|
||||
ansible.builtin.template:
|
||||
src: prometheus.args.j2
|
||||
dest: /opt/homebrew/etc/prometheus.args
|
||||
mode: '0644'
|
||||
notify: restart prometheus
|
||||
|
||||
- name: Ensure prometheus service is started
|
||||
ansible.builtin.command: brew services start prometheus
|
||||
register: brew_start
|
||||
changed_when: "'Successfully started' in brew_start.stdout"
|
||||
failed_when: false
|
||||
3
ansible/roles/prometheus/templates/prometheus.args.j2
Normal file
3
ansible/roles/prometheus/templates/prometheus.args.j2
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
--config.file /opt/homebrew/etc/prometheus.yml
|
||||
--web.listen-address=0.0.0.0:9090
|
||||
--storage.tsdb.path /opt/homebrew/var/prometheus
|
||||
14
ansible/roles/prometheus/templates/prometheus.yml.j2
Normal file
14
ansible/roles/prometheus/templates/prometheus.yml.j2
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
global:
|
||||
scrape_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: "node-exporter-indri"
|
||||
static_configs:
|
||||
- targets: ["localhost:9090"]
|
||||
- targets: ["localhost:9100"]
|
||||
relabel_configs:
|
||||
- target_label: instance
|
||||
replacement: indri
|
||||
- job_name: "node-exporter-sifaka"
|
||||
static_configs:
|
||||
- targets: ["sifaka:9100"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue