Page MenuHomeDevCentral

D1205.id3088.diff
No OneTemporary

D1205.id3088.diff

diff --git a/pillar/top.sls b/pillar/top.sls
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -18,3 +18,4 @@
- paas-jails.jails
- webserver-legacy.sites
- viperserv.bots
+ - viperserv.fantoir
diff --git a/pillar/viperserv/fantoir.sls b/pillar/viperserv/fantoir.sls
new file mode 100644
--- /dev/null
+++ b/pillar/viperserv/fantoir.sls
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------
+# Salt — Deploy eggdrop park
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-11-14
+# License: Trivial work, not eligible to copyright
+# ------------------------------------------------------------
+
+fantoir:
+ dataset_url: http://www.data.gouv.fr/fr/datasets/r/008e7b8f-f52c-4dc6-89ca-3bed2b103746
+ dataset_hash: 4915aead5c3901cb6808137217a94b1e14a8e3d5
+ distname: FANTOIR1017
diff --git a/roles/viperserv/fantoir/init.sls b/roles/viperserv/fantoir/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/viperserv/fantoir/init.sls
@@ -0,0 +1,63 @@
+# -------------------------------------------------------------
+# Salt — Deploy eggdrop park
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-11-14
+# License: Trivial work, not eligible to copyright
+# Data license: FANTOIR is licensed under Licence Ouverte
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Data directories
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/srv/viperserv/data:
+ file.directory:
+ - user: viperserv
+ - group: nasqueron-irc
+ - dir_mode: 770
+
+/srv/viperserv/data/dist:
+ file.directory:
+ - user: viperserv
+ - group: nasqueron-irc
+ - dir_mode: 770
+
+# -------------------------------------------------------------
+# Fetch and extract data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/srv/viperserv/data/dist/fantoir.zip:
+ file.managed:
+ - source: {{ pillar['fantoir']['dataset_url'] }}
+ - source_hash: {{ pillar['fantoir']['dataset_hash'] }}
+ - user: viperserv
+ - group: nasqueron-irc
+
+viperserv_fantoir_archive:
+ archive.extracted:
+ - name: /srv/viperserv/data
+ - source: /srv/viperserv/data/dist/fantoir.zip
+ - enforce_toplevel: False
+ - user: viperserv
+ - group: nasqueron-irc
+ - require:
+ - file: /srv/viperserv/data/dist/fantoir.zip
+
+/srv/viperserv/data/FANTOIR.txt:
+ file.symlink:
+ - target: /srv/viperserv/data/{{ pillar['fantoir']['distname'] }}
+ - require:
+ - archive: viperserv_fantoir_archive
+
+# -------------------------------------------------------------
+# Street data
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+viperserv_fantoir_streets:
+ cmd.run:
+ - name: grep -a "^[0-9]" /srv/viperserv/data/FANTOIR.txt > /srv/viperserv/data/FANTOIR_STREETS.txt
+ - creates: /srv/viperserv/data/FANTOIR_STREETS.txt
+ - runas: viperserv
+ - require:
+ - file: /srv/viperserv/data/FANTOIR.txt
diff --git a/roles/viperserv/init.sls b/roles/viperserv/init.sls
--- a/roles/viperserv/init.sls
+++ b/roles/viperserv/init.sls
@@ -18,3 +18,4 @@
include:
- .account
- .eggdrop
+ - .fantoir

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 01:40 (11 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2265588
Default Alt Text
D1205.id3088.diff (3 KB)

Event Timeline