forked from grafana/grafana-ansible-collection
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put ally vars into the grafana_alloy namespace
- Loading branch information
Showing
9 changed files
with
68 additions
and
68 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
- name: Restart alloy | ||
ansible.builtin.systemd: | ||
name: "{{ service_name }}" | ||
name: "{{ grafana_alloy_service_name }}" | ||
state: restarted | ||
become: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
- name: Create alloy config directory | ||
ansible.builtin.file: | ||
path: "{{ config_dir }}" | ||
path: "{{ grafana_alloy_config_dir }}" | ||
state: directory | ||
owner: "{{ service_user }}" | ||
group: "{{ service_group }}" | ||
owner: "{{ grafana_alloy_service_user }}" | ||
group: "{{ grafana_alloy_service_group }}" | ||
mode: '0755' | ||
become: true | ||
|
||
- name: Deploy alloy configuration file | ||
ansible.builtin.template: | ||
src: config.alloy.j2 | ||
dest: "{{ config_dir }}/{{ config_file }}" | ||
owner: "{{ service_user }}" | ||
group: "{{ service_group }}" | ||
dest: "{{ grafana_alloy_config_dir }}/{{ grafana_alloy_config_file }}" | ||
owner: "{{ grafana_alloy_service_user }}" | ||
group: "{{ grafana_alloy_service_group }}" | ||
mode: '0644' | ||
notify: Restart alloy | ||
become: true | ||
|
||
- name: Deploy alloy environment file | ||
ansible.builtin.template: | ||
src: environment.j2 | ||
dest: "{{ config_dir }}/{{ environment_file }}" | ||
owner: "{{ service_user }}" | ||
group: "{{ service_group }}" | ||
dest: "{{ grafana_alloy_config_dir }}/{{ grafana_alloy_environment_file }}" | ||
owner: "{{ grafana_alloy_service_user }}" | ||
group: "{{ grafana_alloy_service_group }}" | ||
mode: '0644' | ||
notify: Restart alloy | ||
become: true |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{{ config }} | ||
{{ grafana_alloy_config }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{{ ansible_managed | comment }} | ||
# Grafana Alloy Environment File | ||
CONFIG_FILE="{{ config_dir }}/{{ config_file }}" | ||
CONFIG_FILE="{{ grafana_alloy_config_dir }}/{{ grafana_alloy_config_file }}" | ||
|
||
GOMAXPROCS={{ ansible_processor_vcpus|default(ansible_processor_count) }} | ||
RESTART_ON_UPGRADE=true | ||
|
||
{% for key, value in env_file_vars.items() %} | ||
{% for key, value in grafana_alloy_env_file_vars.items() %} | ||
{{key}}={{value}} | ||
{% endfor %} |