From 0a4e530904c17216de5e1a6b4c28e00705e26937 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Tue, 4 Jun 2019 09:56:30 +0100 Subject: [PATCH] Globally ignore files --- states/git/files/gitignore | 6 ++++++ states/git/init.sls | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 states/git/files/gitignore 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'] }} -- 2.46.2