Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3752683
D1247.id3207.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D1247.id3207.diff
View Options
diff --git a/pillar/webserver-legacy/sites.sls b/pillar/webserver-legacy/sites.sls
--- a/pillar/webserver-legacy/sites.sls
+++ b/pillar/webserver-legacy/sites.sls
@@ -38,6 +38,19 @@
- ftp
- trustspace
+# -------------------------------------------------------------
+# PHP sites
+#
+# Username must be unique and use max 31 characters.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+web_php_sites:
+ www.dereckson.be:
+ user: web-be-dereckson-www
+ source: wwwroot/dereckson.be/www
+ target: /var/wwwroot/dereckson.be/www
+ autochmod: True
+
# -------------------------------------------------------------
# Tweaks
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/webserver-legacy/be/dereckson/init.sls b/roles/webserver-legacy/be/dereckson/init.sls
--- a/roles/webserver-legacy/be/dereckson/init.sls
+++ b/roles/webserver-legacy/be/dereckson/init.sls
@@ -7,3 +7,4 @@
include:
- .assets
+ - .www
diff --git a/roles/webserver-legacy/directories.sls b/roles/webserver-legacy/directories.sls
--- a/roles/webserver-legacy/directories.sls
+++ b/roles/webserver-legacy/directories.sls
@@ -22,3 +22,8 @@
- dir_mode: 711
{% endfor %}
{% endfor %}
+
+/var/run/web:
+ file.directory:
+ - group: web
+ - dir_mode: 711
diff --git a/roles/webserver-legacy/init.sls b/roles/webserver-legacy/init.sls
--- a/roles/webserver-legacy/init.sls
+++ b/roles/webserver-legacy/init.sls
@@ -12,6 +12,7 @@
- .directories
- .zr
- .static-sites
+ - .php-sites
- .tweaks
- .be/dereckson
- .org/nasqueron
diff --git a/roles/webserver-legacy/php-sites/account.sls b/roles/webserver-legacy/php-sites/account.sls
new file mode 100644
--- /dev/null
+++ b/roles/webserver-legacy/php-sites/account.sls
@@ -0,0 +1,22 @@
+# -------------------------------------------------------------
+# Salt — Provision PHP websites
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Sites user accounts
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% for domain, site in pillar['web_php_sites'].iteritems() %}
+
+web_account_{{ site['user'] }}:
+ user.present:
+ - name: {{ site['user' ]}}
+ - fullname: {{ domain }}
+ - gid: web
+ - system: True
+ - home: /var/run/web/{{ domain }}
+
+{% endfor %}
diff --git a/roles/webserver-legacy/php-sites/files.sls b/roles/webserver-legacy/php-sites/files.sls
new file mode 100644
--- /dev/null
+++ b/roles/webserver-legacy/php-sites/files.sls
@@ -0,0 +1,24 @@
+# -------------------------------------------------------------
+# Salt — Provision PHP websites
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Sites content
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% for domain, site in pillar['web_php_sites'].iteritems() %}
+
+{{ site['target'] }}:
+ file.recurse:
+ - source: salt://{{ site['source'] }}
+ - exclude_pat: E@.git
+ - include_empty: True
+ - dir_mode: 711
+ - file_mode: keep
+ - user: {{ site['user'] }}
+ - group: web
+
+{% endfor %}
diff --git a/roles/webserver-legacy/be/dereckson/init.sls b/roles/webserver-legacy/php-sites/init.sls
copy from roles/webserver-legacy/be/dereckson/init.sls
copy to roles/webserver-legacy/php-sites/init.sls
--- a/roles/webserver-legacy/be/dereckson/init.sls
+++ b/roles/webserver-legacy/php-sites/init.sls
@@ -1,9 +1,10 @@
# -------------------------------------------------------------
-# Salt — Provision *.dereckson.be sites
+# Salt — Provision PHP websites
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# Project: DcK Area
+# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
include:
- - .assets
+ - .account
+ - .files
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 20:46 (20 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2251163
Default Alt Text
D1247.id3207.diff (4 KB)
Attached To
Mode
D1247: Provision PHP web sites on legacy webserver
Attached
Detach File
Event Timeline
Log In to Comment