From 3aa7de0d4090fccf90fa37481dfea4f5a889e07a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 26 Oct 2017 23:44:14 +0200 Subject: [PATCH] geoserver: basic mapproxy role. --- geoserver/mapproxy/defaults/main.yml | 19 +++++++++++++++++++ geoserver/mapproxy/handlers/main.yml | 0 geoserver/mapproxy/tasks/main.yml | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 geoserver/mapproxy/defaults/main.yml create mode 100644 geoserver/mapproxy/handlers/main.yml create mode 100644 geoserver/mapproxy/tasks/main.yml diff --git a/geoserver/mapproxy/defaults/main.yml b/geoserver/mapproxy/defaults/main.yml new file mode 100644 index 00000000..a4e8b3bd --- /dev/null +++ b/geoserver/mapproxy/defaults/main.yml @@ -0,0 +1,19 @@ +--- +mapproxy_user: mapproxy +mapproxy_virtualenv_path: /srv/mapproxy + +mapproxy_deb_deps: + - python-pip + - python-virtualenv + - python-imaging + - python-yaml + - libproj0 + - libgeos-dev + - python-lxml + - libgdal-dev + - python-shapely + - python-yaml + - python-lxml + +mapproxy_packages: + - MapProxy diff --git a/geoserver/mapproxy/handlers/main.yml b/geoserver/mapproxy/handlers/main.yml new file mode 100644 index 00000000..e69de29b diff --git a/geoserver/mapproxy/tasks/main.yml b/geoserver/mapproxy/tasks/main.yml new file mode 100644 index 00000000..0f332b2c --- /dev/null +++ b/geoserver/mapproxy/tasks/main.yml @@ -0,0 +1,18 @@ +--- +- block: + - name: Create the mapproxy user + become_user: root + user: name={{ mapproxy_user }} home={{ mapproxy_virtualenv_path }} createhome=yes shell=/usr/sbin/nologin system=yes + + - name: Install the mapproxy deb dependencies + become_user: root + apt: pkg={{ item }} update_cache=yes cache_valid_time=3600 + with_items: '{{ mapproxy_deb_deps }}' + + - name: Install mapproxy inside a virtualenv. inherit the site packages + pip: name={{ item }} virtualenv={{ mapproxy_virtualenv_path }} virtualenv_site_packages=yes + with_items: '{{ mapproxy_packages }}' + + become: True + become_user: '{{ mapproxy_user }}' + tags: [ 'mapproxy', 'geoserver' ]