-
-
Notifications
You must be signed in to change notification settings - Fork 6
Add Alloy support to Rocky nodes #664
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| alloy_extra_files: | ||
| - name: dirsrv_access | ||
| path: "/var/log/dirsrv/slapd-*/access" | ||
| - name: dirsrv_error | ||
| path: "/var/log/dirsrv/slapd-*/errors" | ||
|
|
||
| alloy_extra_groups: | ||
| - dirsrv |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| --- | ||
| alloy_grafana_signing_key: "https://apt.grafana.com/gpg.key" | ||
| alloy_grafana_repository: "https://apt.grafana.com" | ||
| alloy_debian_grafana_signing_key: "https://apt.grafana.com/gpg.key" | ||
| alloy_debian_grafana_repository: "https://apt.grafana.com" | ||
|
|
||
| alloy_rocky_grafana_signing_key: "https://rpm.grafana.com/gpg.key" | ||
| alloy_rocky_grafana_repository: "https://rpm.grafana.com" | ||
|
|
||
| alloy_extra_files: [] | ||
| alloy_extra_groups: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,26 @@ | ||
| --- | ||
|
|
||
| - name: Add Grafana apt repository with key | ||
| - name: Add Grafana apt repository (Rocky) | ||
| yum_repository: | ||
| name: grafana | ||
| description: Grafana Repository | ||
| baseurl: "{{ alloy_rocky_grafana_repository }}" | ||
| gpgcheck: true | ||
| gpgkey: "{{ alloy_rocky_grafana_signing_key }}" | ||
| when: ansible_facts["distribution"] == "Rocky" | ||
| tags: | ||
| - role::alloy | ||
|
|
||
| - name: Add Grafana apt repository with key (Debian) | ||
| deb822_repository: | ||
| name: grafana | ||
| types: deb | ||
| uris: "{{ alloy_grafana_repository }}" | ||
| uris: "{{ alloy_debian_grafana_repository }}" | ||
| state: present | ||
| suites: [stable] | ||
| components: [main] | ||
| signed_by: "{{ alloy_grafana_signing_key }}" | ||
| signed_by: "{{ alloy_debian_grafana_signing_key }}" | ||
| when: ansible_facts["distribution"] == "Debian" | ||
| tags: | ||
| - role::alloy | ||
|
|
||
|
|
@@ -61,3 +73,39 @@ | |
| enabled: true | ||
| tags: | ||
| - role::alloy | ||
|
|
||
| - name: Add user to extra groups for Alloy | ||
| user: | ||
| name: "alloy" | ||
| groups: "{{ alloy_extra_groups }}" | ||
| append: true | ||
| when: alloy_extra_groups | length > 0 | ||
| tags: | ||
| - role::alloy | ||
| notify: | ||
| - Restart the alloy service | ||
|
|
||
| # We need to add cap_dac_read_search=+ep to the Alloy binary. | ||
|
|
||
| - name: Get Alloy binary path | ||
| command: "which alloy" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know if ansible sanitizes |
||
| register: alloy_binary_path | ||
| changed_when: false | ||
| tags: | ||
| - role::alloy | ||
|
|
||
| - name: Get the current capabilities of the Alloy binary | ||
| command: "getcap {{ alloy_binary_path.stdout }}" | ||
| register: alloy_getcap_output | ||
| changed_when: false | ||
| tags: | ||
| - role::alloy | ||
|
|
||
| - name: Set capabilities on the Alloy binary | ||
| command: "setcap cap_dac_read_search=ep {{ alloy_binary_path.stdout }}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't this be done via systemd?
|
||
| changed_when: true | ||
| when: "'cap_dac_read_search=ep' not in alloy_getcap_output.stdout" | ||
| tags: | ||
| - role::alloy | ||
| notify: | ||
| - Restart the alloy service | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,35 @@ logging { | |
| level = "info" | ||
| } | ||
|
|
||
| livedebugging { | ||
| enabled = true | ||
| } | ||
|
|
||
|
Comment on lines
+7
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this not expose sensitive information in some way that I'm missing? Judging by the Grafana docs, this relates to the Alloy UI. I haven't followed the deployment - do we expose that somewhere? |
||
| loki.source.journal "system_journal" { | ||
| format_as_json = true | ||
| forward_to = [loki.process.journal_labels.receiver] | ||
| } | ||
|
|
||
| loki.process "journal_labels" { | ||
| forward_to = [loki.write.pydis_gateway.receiver] | ||
|
|
||
| stage.json { | ||
| expressions = { | ||
| unit = "_SYSTEMD_UNIT", | ||
| } | ||
| } | ||
|
|
||
| stage.labels { | ||
| values = { | ||
| unit = "unit", | ||
| } | ||
| } | ||
|
|
||
| stage.static_labels { | ||
| values = { | ||
| job = "system_journal", | ||
| } | ||
| } | ||
| } | ||
|
|
||
| {% for extra in alloy_extra_files %} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.