Temelio / ansible-role-maxmind-geoip

Ansible role to deploy MaxMind geoip databases
MIT License
4 stars 4 forks source link

License / user not configured #82

Open aloonj opened 5 years ago

aloonj commented 5 years ago

This role is working for the most part on an Ubuntu system. The packages install and geoipupdate works, however, the license file at /etc/GeoIP.conf remains with the default values rather than those specificed.

  - role: temelio.maxmind-geoip
  ¦ _maxmind_geoip_geoipupdate_managed: True
  ¦ _maxmind_geoip_packages:
  ¦ - name: 'geoip-database'
  ¦ - name: 'geoip-bin'
  ¦ - name: 'geoipupdate'
  ¦ maxmind_geoip_geoipupdate_product_ids: 106
  ¦ maxmind_geoip_geoipupdate_user_id: 12345
  ¦ maxmind_geoip_geoipupdate_license_key: '12345'
  ¦ maxmind_geoip_geoipupdate_legacy_version: True

TASK [temelio.maxmind-geoip : CONFIG | Manage geoipupdate configuration file] ***** fatal: [9b50757b-785a-4203-834b-1c8bebb91361]: FAILED! => {"changed": false, "msg": "AnsibleError: Unexpected templating type error occurred on (# {{ ansible_managed }}\n\n{% if maxmind_geoip_geoipupdate_legacy_version %}\nUserId {{ maxmind_geoip_geoipupdate_user_id }}\n{% else %}\nAccountID {{ maxmind_geoip_geoipupdate_user_id }}\n{% endif %}\nLicenseKey {{ maxmind_geoip_geoipupdate_license_key }}\n{% if maxmind_geoip_geoipupdate_legacy_version %}\nProductIds {{ maxmind_geoip_geoipupdate_product_ids | join(' ') }}\n{% else %}\nEditionIDs {{ maxmind_geoip_geoipupdate_product_ids | join(' ') }}\n{% endif %}\nDatabaseDirectory {{ maxmind_geoip_databases_folder }}\nHost {{ maxmind_geoip_geoipupdate_host }}\nProtocol {{ maxmind_geoip_geoipupdate_protocol }}\n{% if maxmind_geoip_geoipupdate_proxy != '' %}\nProxy {{ maxmind_geoip_geoipupdate_proxy }}\n{% endif %}\n{% if maxmind_geoip_geoipupdate_proxy_user_password != '' %}\nProxyUserPassword {{ maxmind_geoip_geoipupdate_proxy_user_password }}\n{% endif %}\n{% if maxmind_geoip_geoipupdate_protocol == 'https' %}\nSkipPeerVerification {{ maxmind_geoip_geoipupdate_skip_peer_verification }}\nSkipHostnameVerification {{ maxmind_geoip_geoipupdate_skip_hostname_verification }}\n{% endif %}\n): 'int' object is not iterable"}

aloonj commented 5 years ago

I have managed to avoid the 'int' object not iterable error by editing:

"templates/geoipupdate.conf.j2" line 10

{% if maxmind_geoip_geoipupdate_legacy_version %} 10 ProductIds {{ maxmind_geoip_geoipupdate_product_ids | join(' ') }} 11 {% else %} 12 EditionIDs {{ maxmind_geoip_geoipupdate_product_ids | join(' ') }} 13 {% endif %}

replaced with

{% if maxmind_geoip_geoipupdate_legacy_version %} 10 ProductIds {{ maxmind_geoip_geoipupdate_product_ids }} 11 {% else %} 12 EditionIDs {{ maxmind_geoip_geoipupdate_product_ids | join(' ') }} 13 {% endif %}

And now error gone and correctly updates.

lmachetel commented 5 years ago

Sorry for the late answer, but thank you for this update