Page MenuHomeDevCentral

D3049.diff
No OneTemporary

D3049.diff

diff --git a/pillar/saas/mediawiki.sls b/pillar/saas/mediawiki.sls
--- a/pillar/saas/mediawiki.sls
+++ b/pillar/saas/mediawiki.sls
@@ -33,10 +33,14 @@
mediawiki_saas:
directory: /srv/saas/mediawiki
mediawiki_directory: /srv/mediawiki
+
+ main_fqdn: wikis.nasqueron.org
fastcgi_url: unix:/var/run/web/wikis.nasqueron.org/php-fpm.sock
+
db:
host: 172.27.27.9
user: saas-mediawiki
+
credentials:
db: dbserver/cluster-B/users/saas-mediawiki
secret_key: nasqueron/mediawiki/secret_key
diff --git a/pillar/top.sls b/pillar/top.sls
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -56,6 +56,9 @@
- webserver.labs
- webserver.wwwroot51
+ web-001:
+ - saas.mediawiki
+
windriver:
- devserver.ports
- devserver.repos
diff --git a/pillar/webserver/sites.sls b/pillar/webserver/sites.sls
--- a/pillar/webserver/sites.sls
+++ b/pillar/webserver/sites.sls
@@ -5,6 +5,10 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
+web_aliases:
+ services:
+ - &db-B 172.27.27.9
+
# -------------------------------------------------------------
# Domains we deploy
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -108,8 +112,8 @@
skipCreateUser: True
env:
MEDIAWIKI_ENTRY_POINT: /srv/mediawiki/index.php
- DB_HOST: localhost
- DB_USER: mediawiki-saas
+ DB_HOST: *db-B
+ DB_USER: saas-mediawiki
# Espace Win
www.espace-win.org:
diff --git a/roles/saas-mediawiki/account/init.sls b/roles/saas-mediawiki/account/init.sls
--- a/roles/saas-mediawiki/account/init.sls
+++ b/roles/saas-mediawiki/account/init.sls
@@ -6,6 +6,8 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
+{% set fqdn = pillar["mediawiki_saas"]["main_fqdn"] %}
+
# -------------------------------------------------------------
# Service account
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -22,4 +24,10 @@
- fullname: MediaWiki SaaS
- uid: 3004
- gid: 3004
- - home: /var/run/mediawiki
+ - system: True
+ - home: /var/run/web/{{ fqdn }}
+
+/var/tmp/php/sessions/{{ fqdn }}:
+ file.directory:
+ - mode: 700
+ - user: mediawiki
diff --git a/roles/saas-mediawiki/saas/init.sls b/roles/saas-mediawiki/saas/init.sls
--- a/roles/saas-mediawiki/saas/init.sls
+++ b/roles/saas-mediawiki/saas/init.sls
@@ -22,6 +22,7 @@
saas_mediawiki:
git.latest:
- name: https://devcentral.nasqueron.org/source/saas-mediawiki.git
+ - branch: main
- target: {{ saas["directory"] }}
- update_head: False
- user: mediawiki
@@ -37,7 +38,7 @@
# MediaWiki SaaS credentials
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-{{ saas["directory"] }}/.env
+{{ saas["directory"] }}/.env:
file.managed:
- source: salt://roles/saas-mediawiki/saas/files/dot.env
- user: mediawiki
@@ -45,5 +46,5 @@
- mode: 400
- template: jinja
- context:
- secret_key: {{ credentials.get_password(saas["credentials"]["secret_key"]) }}
- db_pass: {{ credentials.get_password(saas["credentials"]["db"]) }}
+ secret_key: {{ salt["credentials.get_password"](saas["credentials"]["secret_key"]) }}
+ db_pass: {{ salt["credentials.get_password"](saas["credentials"]["db"]) }}
diff --git a/roles/saas-mediawiki/software/init.sls b/roles/saas-mediawiki/software/init.sls
--- a/roles/saas-mediawiki/software/init.sls
+++ b/roles/saas-mediawiki/software/init.sls
@@ -31,7 +31,7 @@
{{ dirs.bin }}/mw:
file.managed:
- - source: roles/saas-mediawiki/software/files/mw.sh.jinja
+ - source: salt://roles/saas-mediawiki/software/files/mw.sh.jinja
- mode: 755
- template: jinja
- context:
diff --git a/top.sls b/top.sls
--- a/top.sls
+++ b/top.sls
@@ -45,3 +45,4 @@
'web-001':
- roles/webserver-core
- roles/webserver-alkane
+ - roles/saas-mediawiki

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 11, 17:38 (17 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2345379
Default Alt Text
D3049.diff (3 KB)

Event Timeline