Page MenuHomeDevCentral

D1404.id3586.diff
No OneTemporary

D1404.id3586.diff

diff --git a/pillar/top.sls b/pillar/devserver/repos.sls
copy from pillar/top.sls
copy to pillar/devserver/repos.sls
--- a/pillar/top.sls
+++ b/pillar/devserver/repos.sls
@@ -2,21 +2,16 @@
# Salt configuration for Nasqueron servers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
-# Created: 2016-04-10
+# Created: 2018-03-08
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-base:
- '*':
- - core.users
- - core.groups
- - certificates.certificates
- - nodes.nodes
- - nodes.forests
- - hotfixes.roles
- - webserver.sites
- ysul:
- - viperserv.bots
- - viperserv.fantoir
- - webserver.labs
- - webserver.wwwroot51
+# Supported VCS: git/hg/svn (git by default)
+
+user_repositories:
+ dereckson:
+ /home/dereckson/dev/dereckson/git-achievements:
+ source: git@github.com:dereckson/git-achievements.git
+ /home/dereckson/.software/hg-prompt:
+ source: http://bitbucket.org/sjl/hg-prompt/
+ vcs: hg
diff --git a/pillar/top.sls b/pillar/top.sls
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -16,6 +16,7 @@
- hotfixes.roles
- webserver.sites
ysul:
+ - devserver.repos
- viperserv.bots
- viperserv.fantoir
- webserver.labs
diff --git a/roles/devserver/userland-home/init.sls b/roles/devserver/userland-home/init.sls
--- a/roles/devserver/userland-home/init.sls
+++ b/roles/devserver/userland-home/init.sls
@@ -8,3 +8,4 @@
include:
- .homefiles
+ - .repos
diff --git a/roles/devserver/userland-home/repos.sls b/roles/devserver/userland-home/repos.sls
new file mode 100644
--- /dev/null
+++ b/roles/devserver/userland-home/repos.sls
@@ -0,0 +1,33 @@
+# -------------------------------------------------------------
+# Deploy user repositories
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2018-03-09
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Clone user repositories
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% for username, user in salt['forest.get_users']().items() %}
+
+{% set repositories = salt['pillar.get']('user_repositories:' + username, {}) %}
+
+{% for target, repo in repositories.items() %}
+{{ target }}:
+ file.directory:
+ - user: {{ username }}
+ - group: {{ username }}
+ {{ repo['vcs'] | default('git') }}.latest:
+ - name: {{ repo['source'] }}
+ - target: {{ target }}
+ - update_head: False
+ {% if salt['node.has_role']('saltmaster') %}
+ # TODO: find an alternative solution for other servers (suggest rSTAGING?)
+ - identity: /opt/salt/security/id_ed25519
+ {% endif %}
+
+{% endfor %}
+
+{% endfor %}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 10:52 (21 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2266595
Default Alt Text
D1404.id3586.diff (2 KB)

Event Timeline