From: Maximilian Friedersdorff Date: Tue, 4 Jun 2019 08:56:30 +0000 (+0100) Subject: Globally ignore files X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=0a4e530904c17216de5e1a6b4c28e00705e26937;p=max%2Fsaltfiles.git Globally ignore files --- diff --git a/states/git/files/gitignore b/states/git/files/gitignore new file mode 100644 index 0000000..6c5ee8d --- /dev/null +++ b/states/git/files/gitignore @@ -0,0 +1,6 @@ +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +*.un~ +Session.vim +.netrwhist +*~ diff --git a/states/git/init.sls b/states/git/init.sls index 4d80ea0..3d1e0df 100644 --- a/states/git/init.sls +++ b/states/git/init.sls @@ -2,7 +2,7 @@ include: - git.{{ grains['os'] | lower }} -{% set git_vars = { +{% set git_confs = { 'color.ui': 'true', 'color.branch': 'always', 'color.status': 'always', @@ -25,10 +25,18 @@ include: } %} -{% for var,val in git_vars.items() %} +{% for var,val in git_confs.items() %} {{ var }}: git.config_set: - value: {{ val }} - global: True - user: {{ grains['user'] }} {% endfor %} + +global gitignore: + file.managed: + - name: {{ grains['homedir'] }}/.gitignore + - source: {{ grains['stateroot'] }}/git/files/gitignore + - mode: 644 + - user: {{ grains['user'] }} + - group: {{ grains['user'] }}