|
12 | 12 | package: |
13 | 13 | name: grafana-data |
14 | 14 | state: absent |
15 | | - register: old_grafana_pkgs |
| 15 | + register: _old_grafana_pkgs |
16 | 16 |
|
17 | 17 | - name: Clean apt cache |
18 | 18 | command: apt clean |
19 | 19 | when: |
20 | | - - old_grafana_pkgs is changed |
| 20 | + - _old_grafana_pkgs is changed |
21 | 21 | - ansible_pkg_mgr == "apt" |
22 | 22 |
|
23 | 23 | - name: Add Grafana repository file [RHEL/CentOS] |
|
34 | 34 | url: "https://packagecloud.io/gpg.key" |
35 | 35 | state: present |
36 | 36 | validate_certs: false |
37 | | - register: _add_apt_key_x86 |
38 | | - until: _add_apt_key_x86 is succeeded |
| 37 | + register: _add_apt_key |
| 38 | + until: _add_apt_key is succeeded |
39 | 39 | retries: 5 |
40 | 40 | delay: 2 |
41 | | - environment: |
42 | | - http_proxy: "{{ http_proxy | default('') }}" |
43 | | - https_proxy: "{{ https_proxy | default('') }}" |
44 | | - when: ansible_architecture == "x86_64" |
45 | 41 |
|
46 | 42 | - name: Add Grafana repository [Debian/Ubuntu] |
47 | 43 | apt_repository: |
48 | | - repo: deb https://packagecloud.io/grafana/stable/debian/ jessie main |
| 44 | + repo: deb https://packagecloud.io/grafana/stable/debian/ stretch main |
49 | 45 | state: present |
50 | | - update_cache: false |
51 | | - register: _apt_add_repo_x86 |
52 | | - when: ansible_architecture == "x86_64" |
53 | | - |
54 | | - - name: Import Grafana GPG signing key [Raspbian] |
55 | | - apt_key: |
56 | | - url: "https://bintray.com/user/downloadSubjectPublicKey?username=bintray" |
57 | | - state: present |
58 | | - validate_certs: false |
59 | | - register: _add_apt_key_arm |
60 | | - until: _add_apt_key_arm is succeeded |
61 | | - retries: 5 |
62 | | - delay: 2 |
63 | | - when: ansible_architecture == "armv6l" or ansible_architecture == "armv7l" |
64 | | - |
65 | | - - name: Add Grafana repository [Raspbian] |
66 | | - apt_repository: |
67 | | - repo: "deb {% if ansible_architecture == 'armv6l' %}https://dl.bintray.com/fg2it/deb-rpi-1b{% else %}https://dl.bintray.com/fg2it/deb{% endif %} {{ ansible_distribution_release }} main" |
68 | | - state: present |
69 | | - update_cache: false |
70 | | - register: _apt_add_repo_arm |
71 | | - when: ansible_architecture == "armv6l" or ansible_architecture == "armv7l" |
72 | | - |
73 | | - - name: Update Apt cache |
74 | | - apt: |
75 | 46 | update_cache: true |
76 | | - when: |
77 | | - - ( _apt_add_repo_x86 is changed ) or |
78 | | - ( _apt_add_repo_arm is changed ) or |
79 | | - ( _add_apt_key_x86 is changed ) or |
80 | | - ( _add_apt_key_arm is changed ) |
81 | 47 | register: _update_apt_cache |
82 | 48 | until: _update_apt_cache is succeeded |
83 | 49 | retries: 5 |
|
0 commit comments