diff --git a/docker/base-app/alpine-3/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/alpine-3/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/alpine-3/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/alpine-3/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/alpine-3/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/alpine-3/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/alpine-3/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/base-app/centos-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/centos-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/centos-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/centos-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/centos-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/centos-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/centos-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/base-app/debian-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/debian-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/debian-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/debian-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/debian-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/debian-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/debian-7/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/base-app/debian-8/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/debian-8/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/debian-8/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/debian-8/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/debian-8/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/debian-8/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/debian-8/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/base-app/debian-9/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/debian-9/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/debian-9/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/debian-9/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/debian-9/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/debian-9/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/debian-9/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/base-app/ubuntu-12.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/ubuntu-12.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/ubuntu-12.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/ubuntu-12.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/ubuntu-12.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/ubuntu-12.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/ubuntu-12.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/base-app/ubuntu-14.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/ubuntu-14.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/ubuntu-14.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/ubuntu-14.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/ubuntu-14.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/ubuntu-14.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/ubuntu-14.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/base-app/ubuntu-15.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/ubuntu-15.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/ubuntu-15.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/ubuntu-15.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/ubuntu-15.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/ubuntu-15.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/ubuntu-15.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/base-app/ubuntu-15.10/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/ubuntu-15.10/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/ubuntu-15.10/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/ubuntu-15.10/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/ubuntu-15.10/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/ubuntu-15.10/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/ubuntu-15.10/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/base-app/ubuntu-16.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/base-app/ubuntu-16.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/base-app/ubuntu-16.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/base-app/ubuntu-16.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/base-app/ubuntu-16.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/base-app/ubuntu-16.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/base-app/ubuntu-16.04/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/provisioning/base-app/general/provision/roles/webdevops-base-app/tasks/bootstrap.yml b/provisioning/base-app/general/provision/roles/webdevops-base-app/tasks/bootstrap.yml index ea9e54682..de53ecfaa 100644 --- a/provisioning/base-app/general/provision/roles/webdevops-base-app/tasks/bootstrap.yml +++ b/provisioning/base-app/general/provision/roles/webdevops-base-app/tasks/bootstrap.yml @@ -5,3 +5,4 @@ - include: bootstrap/dnsmasq.yml - include: bootstrap/postfix.yml - include: bootstrap/ssh.yml +- include: bootstrap/geoip.yml diff --git a/provisioning/base-app/general/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml b/provisioning/base-app/general/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml new file mode 100644 index 000000000..8cb4d9641 --- /dev/null +++ b/provisioning/base-app/general/provision/roles/webdevops-base-app/tasks/bootstrap/geoip.yml @@ -0,0 +1,39 @@ +--- + +- name: Maxmind directory + file: + path: /usr/share/GeoIP/ + mode: 0755 + owner: root + state: directory + +- name: Fetch Maxmind db + get_url: + url: '{{ item.url }}' + dest: '/usr/share/GeoIP/{{ item.dest }}' + mode: 0444 + with_items: + # GeoLite + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', dest: 'GeoLite2-City.mmdb.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', dest: 'GeoLite2-Country.mmdb.gz' } + # Legacy + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', dest: 'GeoIP.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz', dest: 'GeoIPv6.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz', dest: 'GeoLiteCity.dat.gz' } + - { url: 'https://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz', dest: 'GeoLiteCityv6.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz', dest: 'GeoIPASNum.dat.gz' } + - { url: 'https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz', dest: 'GeoIPASNumv6.dat.gz' } + +- name: Extract Maxmind db + command: gunzip -f /usr/share/GeoIP/{{ item }}.gz + with_items: + # GeoLite + - GeoLite2-City.mmdb + - GeoLite2-Country.mmdb + # Legacy + - GeoIP.dat + - GeoIPv6.dat + - GeoLiteCity.dat + - GeoLiteCityv6.dat + - GeoIPASNum.dat + - GeoIPASNumv6.dat diff --git a/test/spec/collection/base-app.rb b/test/spec/collection/base-app.rb index abdb0fa1d..437ec3c3c 100644 --- a/test/spec/collection/base-app.rb +++ b/test/spec/collection/base-app.rb @@ -2,4 +2,5 @@ include_examples 'base-app::layout' include_examples 'base-app::locales' include_examples 'base-app::application-user' + include_examples 'base-app::geoip' end diff --git a/test/spec/shared/base-app/geoip.rb b/test/spec/shared/base-app/geoip.rb new file mode 100644 index 000000000..d14f92156 --- /dev/null +++ b/test/spec/shared/base-app/geoip.rb @@ -0,0 +1,70 @@ +shared_examples 'base-app::geoip' do + ######################### + ## Directories + ######################### + [ + "/usr/share/GeoIP/", + ].each do |file| + describe file("#{file}") do + # Type check + it { should be_directory } + + # Owner test + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } + + # Read test + it { should be_readable.by('owner') } + it { should be_readable.by('group') } + it { should be_readable.by('others') } + + # Write test + it { should be_writable.by('owner') } + it { should_not be_writable.by('group') } + it { should_not be_writable.by('others') } + + # Exectuable test + it { should be_executable.by('owner') } + it { should be_executable.by('group') } + it { should be_executable.by('others') } + end + end + + ######################### + ## Files + ######################### + [ + "GeoLite2-City.mmdb", + "GeoLite2-Country.mmdb", + "GeoIP.dat", + "GeoIPv6.dat", + "GeoLiteCity.dat", + "GeoLiteCityv6.dat", + "GeoIPASNum.dat", + "GeoIPASNumv6.dat", + ].each do |file| + describe file("/usr/share/GeoIP/#{file}") do + # Type check + it { should be_file } + + # Owner test + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } + + # Read test + it { should be_readable.by('owner') } + it { should be_readable.by('group') } + it { should be_readable.by('others') } + + # Write test + it { should_not be_writable.by('owner') } + it { should_not be_writable.by('group') } + it { should_not be_writable.by('others') } + + # Exectuable test + it { should_not be_executable.by('owner') } + it { should_not be_executable.by('group') } + it { should_not be_executable.by('others') } + end + end +end