|
66 | 66 | - name: Download GeoLite2 City archive |
67 | 67 | ansible.builtin.get_url: |
68 | 68 | url: https://download.maxmind.com/geoip/databases/GeoLite2-City/download?suffix=tar.gz |
69 | | - dest: "{{ __fluentbit_geoip_tmp['path'] }}/GeoLite2-City.tar.gz" |
| 69 | + dest: "{{ __fluentbit_geoip_tmp.path }}/GeoLite2-City.tar.gz" |
70 | 70 | mode: '0600' |
71 | 71 | force: true |
72 | 72 | force_basic_auth: true |
|
76 | 76 |
|
77 | 77 | - name: Extract GeoLite2 City archive |
78 | 78 | ansible.builtin.unarchive: |
79 | | - src: "{{ __fluentbit_geoip_tmp['path'] }}/GeoLite2-City.tar.gz" |
80 | | - dest: "{{ __fluentbit_geoip_tmp['path'] }}" |
| 79 | + src: "{{ __fluentbit_geoip_tmp.path }}/GeoLite2-City.tar.gz" |
| 80 | + dest: "{{ __fluentbit_geoip_tmp.path }}" |
81 | 81 | remote_src: true |
82 | 82 |
|
83 | 83 | - name: Locate GeoLite2 City database file |
84 | 84 | ansible.builtin.find: |
85 | | - paths: "{{ __fluentbit_geoip_tmp['path'] }}" |
| 85 | + paths: "{{ __fluentbit_geoip_tmp.path }}" |
86 | 86 | patterns: GeoLite2-City.mmdb |
87 | 87 | recurse: true |
88 | 88 | register: __fluentbit_geoip_found |
89 | 89 |
|
90 | 90 | - name: Ensure GeoLite2 City database was extracted |
91 | 91 | ansible.builtin.fail: |
92 | 92 | msg: GeoLite2-City.mmdb not found in downloaded archive |
93 | | - when: __fluentbit_geoip_found['files'] | length == 0 |
| 93 | + when: __fluentbit_geoip_found.files | length == 0 |
94 | 94 |
|
95 | 95 | - name: Install GeoLite2 City database |
96 | 96 | ansible.builtin.copy: |
97 | | - src: "{{ __fluentbit_geoip_found['files'][0]['path'] }}" |
| 97 | + src: "{{ __fluentbit_geoip_found.files[0]['path'] }}" |
98 | 98 | dest: /etc/fluent-bit/GeoLite2-City.mmdb |
99 | 99 | owner: root |
100 | 100 | group: root |
|
104 | 104 | always: |
105 | 105 | - name: Cleanup GeoIP temporary directory |
106 | 106 | ansible.builtin.file: |
107 | | - path: "{{ __fluentbit_geoip_tmp['path'] }}" |
| 107 | + path: "{{ __fluentbit_geoip_tmp.path }}" |
108 | 108 | state: absent |
109 | 109 | when: |
110 | 110 | - __fluentbit_geoip_tmp is defined |
111 | | - - 'path' in __fluentbit_geoip_tmp |
| 111 | + - "'path' in __fluentbit_geoip_tmp" |
112 | 112 |
|
113 | 113 | - name: Remove old-style configurations |
114 | 114 | ansible.builtin.file: |
|
0 commit comments