Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3752146
D3334.id8622.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
17 KB
Referenced Files
None
Subscribers
None
D3334.id8622.diff
View Options
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -31,25 +31,16 @@
# Build targets - repository
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-repo: roles/webserver-content/init.sls \
- roles/webserver-core/nginx/files/ocsp-ca-certs.pem \
+repo: roles/webserver-core/nginx/files/ocsp-ca-certs.pem \
.git/hooks/pre-commit
-webserver-content-index: clean-webserver-content-index roles/webserver-content/init.sls
-
-roles/webserver-content/init.sls:
- utils/generate-webcontent-index.py > roles/webserver-content/init.sls
-
roles/webserver-core/nginx/files/ocsp-ca-certs.pem:
utils/generate-ocsp-bundle.sh > roles/webserver-core/nginx/files/ocsp-ca-certs.pem
.git/hooks/pre-commit:
pre-commit install
-clean-webserver-content-index:
- ${RM} roles/webserver-content/init.sls
-
-clean-repo: clean-webserver-content-index
+clean-repo:
${RM} .git/hooks/pre-commit
${RM} roles/webserver-core/nginx/files/ocsp-ca-certs.pem
diff --git a/_modules/node.py b/_modules/node.py
--- a/_modules/node.py
+++ b/_modules/node.py
@@ -192,10 +192,6 @@
return any(role in DEPLOY_ROLES for role in get_list("roles", nodename))
-def has_web_content(content, nodename=None):
- return content in filter_by_role("web_content_sls", nodename)
-
-
def get_wwwroot(nodename=None):
"""
A function to determine the wwwroot folder to use.
diff --git a/_tests/modules/test_node.py b/_tests/modules/test_node.py
--- a/_tests/modules/test_node.py
+++ b/_tests/modules/test_node.py
@@ -23,14 +23,6 @@
self.assertEqual("wwwroot/lothlorien.forest/egladil", node.get_wwwroot())
self.assertEqual("wwwroot/entwash.node/www", node.get_wwwroot("entwash"))
- def test_has_web_content(self):
- self.assertTrue(node.has_web_content(".ll/carasgaladhon"))
- self.assertFalse(node.has_web_content(".arda/onodlo"))
-
- self.assertTrue(node.has_web_content(".arda/onodlo", "entwash"))
-
- self.assertFalse(node.has_web_content("notexisting"))
-
def test_filter_by_role(self):
node_key = self.grains["id"]
diff --git a/pillar/tower.sls b/pillar/tower.sls
--- a/pillar/tower.sls
+++ b/pillar/tower.sls
@@ -13,3 +13,5 @@
- paas/docker/{{ minion_id }}/*.sls
- saas/nextcloud/{{ minion_id }}/*.sls
+
+ - webserver/{{ minion_id }}/*.sls
diff --git a/pillar/webserver/dwellers/content.sls b/pillar/webserver/dwellers/content.sls
new file mode 100644
--- /dev/null
+++ b/pillar/webserver/dwellers/content.sls
@@ -0,0 +1,15 @@
+# -------------------------------------------------------------
+# Salt — Sites to provision
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# States
+#
+# Sites with states documenting how to build them
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+web_content_sls:
+ - .org/nasqueron/social
diff --git a/pillar/webserver/eglide/content.sls b/pillar/webserver/eglide/content.sls
new file mode 100644
--- /dev/null
+++ b/pillar/webserver/eglide/content.sls
@@ -0,0 +1,15 @@
+# -------------------------------------------------------------
+# Salt — Sites to provision
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# States
+#
+# Sites with states documenting how to build them
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+web_content_sls:
+ - .org/eglide
diff --git a/pillar/webserver/sites.sls b/pillar/webserver/sites.sls
--- a/pillar/webserver/sites.sls
+++ b/pillar/webserver/sites.sls
@@ -5,48 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-# -------------------------------------------------------------
-# States
-#
-# Sites with states documenting how to build them
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-web_content_sls:
- #
- # Eglide
- #
- shellserver:
- # Directly managed by Eglide project
- - .org/eglide
-
- #
- # Nasqueron servers
- #
- mastodon:
- - .org/nasqueron/social
-
- webserver-legacy: &legacy_to_migrate_to_alkane
- # Nasqueron members
- - .be/dereckson
-
- # Projects hosted
- - .space/hypership
-
- # Directly managed by Nasqueron
- - .org/nasqueron/api
- - .org/nasqueron/autoconfig
- - .org/nasqueron/daeghrefn
- - .org/nasqueron/docs
- - .org/nasqueron/infra
- - .org/nasqueron/labs
- - .org/nasqueron/rain
-
- # Wolfplex Hackerspace
- - .org/wolfplex/api
- - .org/wolfplex/www
-
- webserver-alkane: *legacy_to_migrate_to_alkane
-
# -------------------------------------------------------------
# Sites deployed through Jenkins CD
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/webserver-content/init.sls b/pillar/webserver/web-001/content.sls
copy from roles/webserver-content/init.sls
copy to pillar/webserver/web-001/content.sls
--- a/roles/webserver-content/init.sls
+++ b/pillar/webserver/web-001/content.sls
@@ -1,18 +1,18 @@
# -------------------------------------------------------------
-# Salt — Webserver content
+# Salt — Sites to provision
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-#
-# <auto-generated>
-# This file is auto-generated by running
-# `make webserver-content-index`.
-# </auto-generated>
-include:
+web_content_sls:
+ # Nasqueron members
- .be/dereckson
- - .org/eglide
+
+ # Projects hosted
+ - .space/hypership
+
+ # Directly managed by Nasqueron
- .org/nasqueron/api
- .org/nasqueron/autoconfig
- .org/nasqueron/daeghrefn
@@ -20,9 +20,7 @@
- .org/nasqueron/infra
- .org/nasqueron/labs
- .org/nasqueron/rain
- - .org/nasqueron/social
+
+ # Wolfplex Hackerspace
- .org/wolfplex/api
- .org/wolfplex/www
- - .space/hypership
-
- - ._generic
diff --git a/pillar/webserver/windriver/content.sls b/pillar/webserver/windriver/content.sls
new file mode 100644
--- /dev/null
+++ b/pillar/webserver/windriver/content.sls
@@ -0,0 +1,14 @@
+# -------------------------------------------------------------
+# Salt — Sites to provision
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# States
+#
+# Sites with states documenting how to build them
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+web_content_sls: []
diff --git a/roles/webserver-content/README.md b/roles/webserver-content/README.md
--- a/roles/webserver-content/README.md
+++ b/roles/webserver-content/README.md
@@ -28,9 +28,7 @@
1. Create a new folder hierarchy for the domain
2. Include a `init.sls` file for your subdomains
- 3. Declare the new domain in pillar/webserver/sites.sls
- 4. Regenerate the role index with `make` (from repository root)
-
+ 3. Declare the new domain in pillar/webserver
For example the tld/acme/init.sls file could be:
```
@@ -46,10 +44,7 @@
If you wish to deploy all the sites on one role, you can directly include
the folder, and your init.sls will do the rest.
-If not, two strategies exist: you can use node.filter_by_role in your
-init.sls too or perhaps more simply you can document in init.sls these
-roles can't be deployed directly, and make references to sls files in
-the pillar (without final .sls extension).
+If not, you can list the path to the subdomain file, without the .sls extension.
For example to deploy bipbip.acme.tld (`tld/acme/bipbip.sls`) on servers
with the shellserver role:
diff --git a/roles/webserver-content/be/dereckson/assets.sls b/roles/webserver-content/be/dereckson/assets.sls
--- a/roles/webserver-content/be/dereckson/assets.sls
+++ b/roles/webserver-content/be/dereckson/assets.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/nasqueron/assets") %}
-
# -------------------------------------------------------------
# Deploy /opt/staging/wwwroot/d.be/assets to assets.d.be
#
@@ -25,5 +23,3 @@
- file_mode: 644
- user: dereckson.be
- group: web
-
-{% endif %}
diff --git a/roles/webserver-content/init.sls b/roles/webserver-content/init.sls
--- a/roles/webserver-content/init.sls
+++ b/roles/webserver-content/init.sls
@@ -4,25 +4,10 @@
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-#
-# <auto-generated>
-# This file is auto-generated by running
-# `make webserver-content-index`.
-# </auto-generated>
include:
- - .be/dereckson
- - .org/eglide
- - .org/nasqueron/api
- - .org/nasqueron/autoconfig
- - .org/nasqueron/daeghrefn
- - .org/nasqueron/docs
- - .org/nasqueron/infra
- - .org/nasqueron/labs
- - .org/nasqueron/rain
- - .org/nasqueron/social
- - .org/wolfplex/api
- - .org/wolfplex/www
- - .space/hypership
+ {% for state in pillar["web_content_sls"] %}
+ - {{ state }}
+ {% endfor %}
- ._generic
diff --git a/roles/webserver-content/org/eglide/www.sls b/roles/webserver-content/org/eglide/www.sls
--- a/roles/webserver-content/org/eglide/www.sls
+++ b/roles/webserver-content/org/eglide/www.sls
@@ -6,8 +6,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/eglide") %}
-
# -------------------------------------------------------------
# Deploy /opt/staging/wwwroot/eglide.org/www to www.eglide.org
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/roles/webserver-content/org/nasqueron/api.sls b/roles/webserver-content/org/nasqueron/api.sls
--- a/roles/webserver-content/org/nasqueron/api.sls
+++ b/roles/webserver-content/org/nasqueron/api.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/nasqueron/api") %}
-
# -------------------------------------------------------------
# Base part from rOPS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -65,5 +63,3 @@
- user: web-org-nasqueron-api-serverslog
- mode: 644
- replace: False
-
-{% endif %}
diff --git a/roles/webserver-content/org/nasqueron/autoconfig.sls b/roles/webserver-content/org/nasqueron/autoconfig.sls
--- a/roles/webserver-content/org/nasqueron/autoconfig.sls
+++ b/roles/webserver-content/org/nasqueron/autoconfig.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/nasqueron/autoconfig") %}
-
# -------------------------------------------------------------
# Base directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -25,5 +23,3 @@
module.run:
- name: jenkins.build_job
- m_name: deploy-website-nasqueron-www1-autoconfig
-
-{% endif %}
diff --git a/roles/webserver-content/org/nasqueron/daeghrefn.sls b/roles/webserver-content/org/nasqueron/daeghrefn.sls
--- a/roles/webserver-content/org/nasqueron/daeghrefn.sls
+++ b/roles/webserver-content/org/nasqueron/daeghrefn.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/nasqueron/rain") %}
-
# -------------------------------------------------------------
# Base directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -25,5 +23,3 @@
module.run:
- name: jenkins.build_job
- m_name: deploy-website-nasqueron-www1-daeghrefn
-
-{% endif %}
diff --git a/roles/webserver-content/org/nasqueron/docs.sls b/roles/webserver-content/org/nasqueron/docs.sls
--- a/roles/webserver-content/org/nasqueron/docs.sls
+++ b/roles/webserver-content/org/nasqueron/docs.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/nasqueron/docs") %}
-
{% from "map.jinja" import dirs, packages with context %}
# -------------------------------------------------------------
@@ -97,5 +95,3 @@
module.run:
- name: jenkins.build_job
- m_name: docker-registry-api
-
-{% endif %}
diff --git a/roles/webserver-content/org/nasqueron/infra.sls b/roles/webserver-content/org/nasqueron/infra.sls
--- a/roles/webserver-content/org/nasqueron/infra.sls
+++ b/roles/webserver-content/org/nasqueron/infra.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/nasqueron/infra") %}
-
# -------------------------------------------------------------
# Base directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -25,5 +23,3 @@
module.run:
- name: jenkins.build_job
- m_name: deploy-website-nasqueron-www1-infra
-
-{% endif %}
diff --git a/roles/webserver-content/org/nasqueron/labs.sls b/roles/webserver-content/org/nasqueron/labs.sls
--- a/roles/webserver-content/org/nasqueron/labs.sls
+++ b/roles/webserver-content/org/nasqueron/labs.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/nasqueron/labs") %}
-
# -------------------------------------------------------------
# Base directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -44,5 +42,3 @@
- file_mode: 644
- clean: False
{% endfor %}
-
-{% endif %}
diff --git a/roles/webserver-content/org/nasqueron/rain.sls b/roles/webserver-content/org/nasqueron/rain.sls
--- a/roles/webserver-content/org/nasqueron/rain.sls
+++ b/roles/webserver-content/org/nasqueron/rain.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/nasqueron/rain") %}
-
# -------------------------------------------------------------
# Base directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -25,5 +23,3 @@
module.run:
- name: jenkins.build_job
- m_name: deploy-website-nasqueron-www1-rain
-
-{% endif %}
diff --git a/roles/webserver-content/org/nasqueron/social.sls b/roles/webserver-content/org/nasqueron/social.sls
--- a/roles/webserver-content/org/nasqueron/social.sls
+++ b/roles/webserver-content/org/nasqueron/social.sls
@@ -6,8 +6,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/nasqueron/social") %}
-
/srv/data/mastodon/public/support:
file.recurse:
- source: salt://wwwroot/nasqueron.org/mastodon/support
@@ -16,5 +14,3 @@
- clean: True
- dir_mode: 711
- file_mode: 644
-
-{% endif %}
diff --git a/roles/webserver-content/org/wolfplex/api.sls b/roles/webserver-content/org/wolfplex/api.sls
--- a/roles/webserver-content/org/wolfplex/api.sls
+++ b/roles/webserver-content/org/wolfplex/api.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/wolfplex/api") %}
-
# -------------------------------------------------------------
# Data store
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -56,5 +54,3 @@
- runas: web-org-wolfplex-www
- cwd: /var/wwwroot/wolfplex.org/api/design/kibaone/accents
- creates: /var/wwwroot/wolfplex.org/api/design/kibaone/accents/index.json
-
-{% endif %}
diff --git a/roles/webserver-content/org/wolfplex/www.sls b/roles/webserver-content/org/wolfplex/www.sls
--- a/roles/webserver-content/org/wolfplex/www.sls
+++ b/roles/webserver-content/org/wolfplex/www.sls
@@ -6,8 +6,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".org/wolfplex/www") %}
-
/var/wwwroot/wolfplex.org/www/2013:
file.recurse:
- source: salt://software/wolfplex/web-campaigns-2013
@@ -23,5 +21,3 @@
file.directory:
- user: web-org-wolfplex-www
- group: web
-
-{% endif %}
diff --git a/roles/webserver-content/space/hypership/www.sls b/roles/webserver-content/space/hypership/www.sls
--- a/roles/webserver-content/space/hypership/www.sls
+++ b/roles/webserver-content/space/hypership/www.sls
@@ -5,8 +5,6 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% if salt['node.has_web_content'](".space/hypership") %}
-
/var/dataroot/zed:
file.directory:
- user: deploy
@@ -64,5 +62,3 @@
file.directory:
- user: web-space-hypership-www
{% endfor %}
-
-{% endif %}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 16:27 (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2250827
Default Alt Text
D3334.id8622.diff (17 KB)
Attached To
Mode
D3334: Simplify webserver-content management
Attached
Detach File
Event Timeline
Log In to Comment