]> git.friedersdorff.com Git - max/saltfiles.git/commitdiff
Start implementing git config in saltfiles
authorMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 4 Jun 2019 08:39:16 +0000 (09:39 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 4 Jun 2019 08:39:16 +0000 (09:39 +0100)
states/dotfiles.sls
states/git/gentoo.sls [new file with mode: 0644]
states/git/init.sls [new file with mode: 0644]

index 6ad7e297912b0d7f60b260505092f12d48c6f7e3..cf4225a9d780749fd71c9e007f198ea009f67114 100644 (file)
@@ -1,2 +1,3 @@
 include:
   - bash
+  - git
diff --git a/states/git/gentoo.sls b/states/git/gentoo.sls
new file mode 100644 (file)
index 0000000..209abdb
--- /dev/null
@@ -0,0 +1,20 @@
+{% set git_useflags = [
+  'gpg'
+] %}
+
+set useflags:
+  file.managed:
+    - name: /etc/portage/package.use/git-salt
+    - contents:
+  {% for flag in git_useflags %}
+      - dev-vcs/git {{ flag }}
+  {% endfor %}
+    - user: root
+    - group: root
+    - mode: 644
+    - require_in:
+      - pkg: git installed
+
+git installed:
+  pkg.installed:
+    - name: dev-vcs/git
diff --git a/states/git/init.sls b/states/git/init.sls
new file mode 100644 (file)
index 0000000..b1dc69e
--- /dev/null
@@ -0,0 +1,17 @@
+include:
+  - git.{{ grains['os'] | lower }}
+
+
+{% set git_vars = {
+  'user.name': 'Maximilian Friedersdorff',
+  'user.email': 'max@friedersdorff.com'
+}
+%}
+
+{% for var,val in git_vars.items() %}
+{{ var }}:
+  git.config_set:
+    - value: {{ val }}
+    - global: True
+    - user: {{ grains['user'] }}
+{% endfor %}