Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3993665
D1082.id2792.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
D1082.id2792.diff
View Options
diff --git a/GIDs b/GIDs
--- a/GIDs
+++ b/GIDs
@@ -3,3 +3,4 @@
829 nasqueron-irc
9001 salt
9002 deploy
+9003 web
diff --git a/pillar/top.sls b/pillar/top.sls
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -11,6 +11,8 @@
- core.hostnames
- certificates.certificates
- nodes.nodes
+ ysul:
+ - webserver-legacy.sites
eglide:
- users.revokedusers
- users.shellusers
diff --git a/pillar/webserver-legacy/sites.sls b/pillar/webserver-legacy/sites.sls
new file mode 100644
--- /dev/null
+++ b/pillar/webserver-legacy/sites.sls
@@ -0,0 +1,38 @@
+# -------------------------------------------------------------
+# Salt — Sites to provision on the legacy web server
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Domains we deploy
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+web_domains:
+ #
+ # Directly managed by Nasqueron
+ #
+ nasqueron:
+ - nasqueron.org
+ #
+ # Nasqueron members
+ #
+ nasqueron_members:
+ - dereckson.be
+ #
+ # Wolfplex
+ #
+ wolfplex:
+ - wolfplex.be
+
+# -------------------------------------------------------------
+# Static sites
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+web_static_sites:
+ nasqueron.org:
+ - www
+ - docker
+ - ftp
+ - trustspace
diff --git a/roles/webserver-legacy/init.sls b/roles/webserver-legacy/account.sls
copy from roles/webserver-legacy/init.sls
copy to roles/webserver-legacy/account.sls
--- a/roles/webserver-legacy/init.sls
+++ b/roles/webserver-legacy/account.sls
@@ -7,6 +7,19 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-include:
- - .be/dereckson
- - .org/nasqueron
+webserver_legacy_group:
+ group.present:
+ - name: web
+ - gid: 9003
+ - system: True
+
+{% for domains_group in pillar['web_domains'] %}
+{% for domain in pillar['web_domains'][domains_group] %}
+webserver_user_{{ domain }}:
+ user.present:
+ - name: {{ domain }}
+ - gid: 9003
+ - createhome: False
+ - fullname: Websites account for {{ domain }}
+{% endfor %}
+{% endfor %}
diff --git a/roles/webserver-legacy/init.sls b/roles/webserver-legacy/directories.sls
copy from roles/webserver-legacy/init.sls
copy to roles/webserver-legacy/directories.sls
--- a/roles/webserver-legacy/init.sls
+++ b/roles/webserver-legacy/directories.sls
@@ -7,6 +7,18 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-include:
- - .be/dereckson
- - .org/nasqueron
+/var/wwwroot:
+ file.directory:
+ - group: web
+ - dir_mode: 711
+
+{% for domains_group in pillar['web_domains'] %}
+{% for domain in pillar['web_domains'][domains_group] %}
+webserver_directory_{{ domain }}:
+ file.directory:
+ - name: /var/wwwroot/{{ domain }}
+ - user: {{ domain }}
+ - group: web
+ - dir_mode: 711
+{% endfor %}
+{% endfor %}
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
@@ -8,5 +8,8 @@
# -------------------------------------------------------------
include:
+ - .account
+ - .directories
+ - .static-sites
- .be/dereckson
- .org/nasqueron
diff --git a/roles/webserver-legacy/static-sites.sls b/roles/webserver-legacy/static-sites.sls
new file mode 100644
--- /dev/null
+++ b/roles/webserver-legacy/static-sites.sls
@@ -0,0 +1,20 @@
+# -------------------------------------------------------------
+# Salt — Provision static *.nasqueron.org websites
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% for domain in pillar['web_static_sites'] %}
+{% for subdomain in pillar['web_static_sites'][domain] %}
+/var/wwwroot/{{ domain }}/{{ subdomain }}:
+ file.recurse:
+ - source: salt://wwwroot/{{ domain }}/{{ subdomain }}
+ - exclude_pat: E@.git
+ - include_empty: True
+ - dir_mode: 755
+ - file_mode: 644
+ - user: {{ domain }}
+ - group: web
+{% endfor %}
+{% endfor %}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 09:01 (19 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2344413
Default Alt Text
D1082.id2792.diff (4 KB)
Attached To
Mode
D1082: Deploy static sites to /var/wwwroot
Attached
Detach File
Event Timeline
Log In to Comment