Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Ansible doc to use the alloy role instead of Agent #164

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions docs/sources/get-started/install/ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ noindex: true

# Install or uninstall {{% param "FULL_PRODUCT_NAME" %}} using Ansible

You can use Ansible to install and manage {{< param "PRODUCT_NAME" >}} on Linux hosts.
You can use [Grafana Ansible Collection](https://github.com/grafana/grafana-ansible-collection) to install and manage {{< param "PRODUCT_NAME" >}} on Linux hosts.

## Before you begin

Expand All @@ -25,24 +25,31 @@ To add {{% param "PRODUCT_NAME" %}} to a host:
1. Create a file named `alloy.yml` and add the following:

```yaml
- name: Install Grafana Alloy
- name: Install Alloy
hosts: all
become: true

tasks:
- name: Install Grafana Alloy
- name: Install Alloy
ansible.builtin.include_role:
name: grafana.grafana.alloy
vars:
# Destination file name
grafana_alloy_config_filename: config.alloy
# Local file to copy
grafana_alloy_provisioned_config_file: "<path-to-config-file-on-localhost>"
grafana_alloy_flags_extra:
server.http.listen-addr: '0.0.0.0:12345'
config: |
prometheus.scrape "default" {
targets = [{"__address__" = "localhost:12345"}]
forward_to = [prometheus.remote_write.prom.receiver]
}
prometheus.remote_write "prom" {
endpoint {
url = "YOUR_PROMETHEUS_PUSH_ENDPOINT"
}
}
```

Replace the following:
- _`<path-to-config-file-on-localhost>`_: The path to the {{< param "PRODUCT_NAME" >}} configuration file on the Ansible Controller (Localhost).
The above snippet has a sample configuration to collect and send Alloy metrics to Prometheus

Replace the following:
- _`YOUR_PROMETHEUS_PUSH_ENDPOINT`_: With the Remote write endpoint of your Prometheus Instance.

1. Run the Ansible playbook. Open a terminal window and run the following command from the Ansible playbook directory.

Expand Down Expand Up @@ -76,5 +83,5 @@ Main PID: 3176 (alloy-linux-amd)

- [Configure {{< param "PRODUCT_NAME" >}}][Configure]

[Ansible]: https://www.ansible.com/
[Grafana Ansible Collection]: https://github.com/grafana/grafana-ansible-collection
[Configure]: ../../../tasks/configure/configure-linux/
Loading