From: Maximilian Friedersdorff Date: Tue, 4 Jun 2019 08:39:16 +0000 (+0100) Subject: Start implementing git config in saltfiles X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=9da99176cb93e27da861bb0bbef089fb5de31590;p=max%2Fsaltfiles.git Start implementing git config in saltfiles --- diff --git a/states/dotfiles.sls b/states/dotfiles.sls index 6ad7e29..cf4225a 100644 --- a/states/dotfiles.sls +++ b/states/dotfiles.sls @@ -1,2 +1,3 @@ include: - bash + - git diff --git a/states/git/gentoo.sls b/states/git/gentoo.sls new file mode 100644 index 0000000..209abdb --- /dev/null +++ b/states/git/gentoo.sls @@ -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 index 0000000..b1dc69e --- /dev/null +++ b/states/git/init.sls @@ -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 %}