Last active
July 7, 2024 11:23
-
-
Save FredrikWendt/bc17485ebe0953cbc904c844126d5d8f to your computer and use it in GitHub Desktop.
A simple playbook for installing, configuring and starting a Sensu Go agent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: yes | |
tasks: | |
# Sensu, agents run on dom0 | |
- name: PGP signing key for Sensu packages | |
apt_key: | |
id: A5BC3FB70A3F7426 | |
url: https://packagecloud.io/sensu/stable/gpgkey | |
state: present | |
- name: PGP signing key for Sensu community packages | |
apt_key: | |
id: 6A8D4DDAE50F9E23 | |
url: https://packagecloud.io/sensu/community/gpgkey | |
state: present | |
- name: Install Sensu packages repository | |
apt_repository: | |
repo: "deb https://packagecloud.io/sensu/stable/ubuntu/ {{ ansible_distribution_release }} main" | |
state: present | |
filename: sensu-stable | |
- name: Install Sensu Ruby Plugins repository | |
apt_repository: | |
repo: "deb https://packagecloud.io/sensu/community/ubuntu/ {{ ansible_distribution_release }} main" | |
state: present | |
filename: sensu-community | |
- name: Install Sensu Agent | |
apt: | |
name: sensu-go-agent | |
state: latest | |
update_cache: yes | |
- name: Install Sensu CLI tool | |
apt: | |
name: sensu-go-cli | |
state: latest | |
- name: Install Sensu Plugins Ruby package | |
apt: | |
name: sensu-plugins-ruby | |
state: latest | |
update_cache: yes | |
- name: Basic configuration file for Sensu agent | |
copy: | |
dest: "/etc/sensu/agent.yml" | |
force: no | |
content: | | |
backend-url: | |
- "ws://INTERNALLY_ACCESSIBLE_ENDPOINT:8081" | |
agent-managed-entity: true | |
statsd-event-handlers: | |
- influxdb | |
- graphite | |
- name: Restart sensu | |
service: | |
name: sensu-agent | |
enabled: yes | |
state: restarted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment