Page MenuHomeDevCentral

D2549.id6431.diff
No OneTemporary

D2549.id6431.diff

diff --git a/pillar/saas/wordpress.sls b/pillar/saas/wordpress.sls
new file mode 100644
--- /dev/null
+++ b/pillar/saas/wordpress.sls
@@ -0,0 +1,57 @@
+# -------------------------------------------------------------
+# SaaS WordPress - List of instances
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Description: Allow to match hosts and database settings
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+multisite_instance: &multisite_instance
+ database_name: saas_wordpress
+ database_prefix: wp_
+ flavour: multisite
+
+wordpress_instances:
+
+ # -------------------------------------------------------------
+ # Multisite instances
+ #
+ # If creating a fresh site, it is probably best to add it here.
+ #
+ # The multisite instances are hosted as one WordPress app,
+ # managed as multisite directly through WordPress.
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ # Test multisite (formerly WordPress MU)
+ StagingMultiSite:
+ <<: *multisite_instance
+ host: wordpress-mu.saas.nasqueron.org
+
+ # -------------------------------------------------------------
+ # Standalone instances
+ #
+ # Those instances have their own database, for one site,
+ # and multisite is NOT enabled.
+ #
+ # We offer this mode to try to offer a smooth transition path,
+ # as "nothing changes" for the site, and it can be attached or
+ # detached to this SaaS at any time.
+ #
+ # Instances share the same codebase, and so provide the same
+ # access to wp-content/. The multisite aspect is managed by
+ # the SaaS by providing a different configuration for each
+ # site.
+ #
+ # Upload folder will be /srv/saas/wordpress/uploads/<instance>
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ # Test standalone
+ StagingStandaloneSite:
+ host: wordpress.saas.nasqueron.org
+
+ # DcK Area
+ DerecksonArea:
+ host: www.dereckson.be
+ database_name: Dereckson_Blog
+ database_prefix: wp_
+ flavour: standalone
diff --git a/pillar/top.sls b/pillar/top.sls
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -41,6 +41,7 @@
- devserver.repos
- credentials.zr
- saas.mediawiki
+ - saas.wordpress
- viperserv.bots
- viperserv.fantoir
- webserver.labs
diff --git a/roles/saas-wordpress/config/files/instances.yml b/roles/saas-wordpress/config/files/instances.yml
new file mode 100644
--- /dev/null
+++ b/roles/saas-wordpress/config/files/instances.yml
@@ -0,0 +1,19 @@
+# -------------------------------------------------------------
+# SaaS WordPress - List of instances
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Description: Allow to match hosts and database settings
+# License: Trivial work, not eligible to copyright
+# Source file: pillar/saas/wordpress.sls
+# roles/saas-wordpress/config/files/instances.yml
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+instances:
+ {{ instances | yaml_encode }}
diff --git a/roles/saas-wordpress/config/init.sls b/roles/saas-wordpress/config/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/saas-wordpress/config/init.sls
@@ -0,0 +1,16 @@
+# -------------------------------------------------------------
+# Salt — WordPress farm
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs %}
+
+{{ dirs.etc }}/saas/wordpress/instances.yml:
+ file.managed:
+ - source: salt://roles/saas-wordpress/config/files/instances.yml
+ - makedirs: True
+ - template: jinja
+ - context:
+ instances: {{ pillar['wordpress_instances'] }}
diff --git a/roles/saas-wordpress/init.sls b/roles/saas-wordpress/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/saas-wordpress/init.sls
@@ -0,0 +1,9 @@
+# -------------------------------------------------------------
+# Salt — WordPress farm
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .config

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 11:55 (17 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2257364
Default Alt Text
D2549.id6431.diff (4 KB)

Event Timeline