diff --git a/roles/geoipupdate/tasks/main.yml b/roles/geoipupdate/tasks/main.yml index ab8ed90ff6d6c4ac600dbf3d0b9dc7cf71ce42b8..16fe988b445e08bd86591ccc437678e2808c1beb 100644 --- a/roles/geoipupdate/tasks/main.yml +++ b/roles/geoipupdate/tasks/main.yml @@ -4,18 +4,7 @@ pacman: name=geoipupdate state=present - name: configure geoipupdate - lineinfile: - path: /etc/GeoIP.conf - regex: '^#*\s*{{ item.setting }} ' - line: '{{ item.setting }} {{ item.value }}' - owner: root - group: root - mode: 0600 - no_log: true - loop: - - { setting: AccountID, value: '{{ vault_mirror_maxmind_id }}' } - - { setting: LicenseKey, value: '{{ vault_mirror_maxmind_license }}' } - - { setting: EditionIDs, value: '{{ geoipupdate_edition_ids }}' } + template: src=GeoIP.conf.j2 dest=/etc/GeoIP.conf owner=root group=root mode=0600 - name: create drop-in directory for geoipupdate.service file: path=/etc/systemd/system/geoipupdate.service.d state=directory owner=root group=root mode=0755 diff --git a/roles/geoipupdate/templates/GeoIP.conf.j2 b/roles/geoipupdate/templates/GeoIP.conf.j2 new file mode 100644 index 0000000000000000000000000000000000000000..cbe1ee1286170806b1aafaada9ad4d8ecdd11070 --- /dev/null +++ b/roles/geoipupdate/templates/GeoIP.conf.j2 @@ -0,0 +1,4 @@ +AccountID {{ vault_mirror_maxmind_id }} +LicenseKey {{ vault_mirror_maxmind_license }} + +EditionIDs {{ geoipupdate_edition_ids }}