Skip to content

Commit

Permalink
use new standard to configure Grafana APT source
Browse files Browse the repository at this point in the history
  • Loading branch information
pierresebastien committed Aug 28, 2023
1 parent b10da86 commit cc4c41b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions roles/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
| `grafana_yum_key` | https://packages.grafana.com/gpg.key | Yum repository gpg key |
| `grafana_rhsm_subscription` | | rhsm subscription name (redhat subscription-manager) |
| `grafana_rhsm_repo` | | rhsm repository name (redhat subscription-manager) |
| `grafana_apt_repo` | deb https://packages.grafana.com/oss/deb stable main | Apt repository string |
| `grafana_apt_key` | https://packages.grafana.com/gpg.key | Apt repository gpg key |
| `grafana_apt_release_channel` | stable | Apt release chanel (stable or beta) |
| `grafana_apt_arch` | {{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }} | Apt architecture |
| `grafana_apt_repo` | deb [arch={{ grafana_apt_arch }} signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com/ {{ grafana_apt_release_channel }} main | Apt repository string |
| `grafana_apt_key` | https://apt.grafana.com/gpg.key | Apt repository gpg key |
| `grafana_instance` | {{ ansible_fqdn \| default(ansible_host) \| default(inventory_hostname) }} | Grafana instance name |
| `grafana_logs_dir` | /var/log/grafana | Path to logs directory |
| `grafana_data_dir` | /var/lib/grafana | Path to database directory |
Expand Down
6 changes: 4 additions & 2 deletions roles/grafana/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ grafana_yum_key: "https://packages.grafana.com/gpg.key"
grafana_rhsm_subscription: ""
grafana_rhsm_repo: ""

grafana_apt_repo: "deb https://packages.grafana.com/oss/deb stable main"
grafana_apt_key: "https://packages.grafana.com/gpg.key"
grafana_apt_release_channel: stable
grafana_apt_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}"
grafana_apt_repo: "deb [arch={{ grafana_apt_arch }} signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com/ {{ grafana_apt_release_channel }} main"

Check warning on line 13 in roles/grafana/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Perform Linting

13:151 [line-length] line too long (159 > 150 characters)
grafana_apt_key: "https://apt.grafana.com/gpg.key"

# Should we use the provisioning capability when possible (provisioning require grafana >= 5.0)
grafana_use_provisioning: true
Expand Down
6 changes: 3 additions & 3 deletions roles/grafana/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
environment: "{{ grafana_environment }}"
block:
- name: "Import Grafana apt gpg key"
ansible.builtin.apt_key:
ansible.builtin.get_url:
url: "{{ grafana_apt_key }}"
state: present
validate_certs: false
dest: /usr/share/keyrings/grafana.key
mode: "0644"

- name: "Add Grafana apt repository"
ansible.builtin.apt_repository:
Expand Down

0 comments on commit cc4c41b

Please sign in to comment.