diff --git a/pillars/roles/git/saltmaster.sls b/pillars/roles/git/saltmaster.sls index 05d6f71..0b4f612 100644 --- a/pillars/roles/git/saltmaster.sls +++ b/pillars/roles/git/saltmaster.sls @@ -1,3 +1,10 @@ +{%- set branches=salt.cmd.shell('git ls-remote https://git.actcur.com/actcur/salt.git | grep -o -P "(?<=refs/heads/).*" | grep -Pv "(^temp$)|(^history$)"').split('\n') -%} +branches: + saltmaster: +{%- for branch in branches %} + - {{branch}} +{%- endfor %} + git: salt: repo: "ssh://gitea@git.actcur.com:5022/actcur/salt.git" diff --git a/states/roles/maintain/saltmaster/init.sls b/states/roles/maintain/saltmaster/init.sls index ef3f1a3..bab7e93 100644 --- a/states/roles/maintain/saltmaster/init.sls +++ b/states/roles/maintain/saltmaster/init.sls @@ -1,10 +1,3 @@ -{%- set os=grains['os'] -%} - -/test: - file.managed: - - source: salt://roles/maintain/saltmaster/test - - template: jinja - salt-master: {%- if os=="CentOS" or os=="RedHat" %} pkg.installed: [] diff --git a/states/roles/maintain/saltmaster/test b/states/roles/maintain/saltmaster/test deleted file mode 100644 index 48ac69d..0000000 --- a/states/roles/maintain/saltmaster/test +++ /dev/null @@ -1,7 +0,0 @@ -{%- set branches=salt.cmd.shell('git ls-remote https://git.actcur.com/actcur/salt.git | grep -o -P "(?<=refs/heads/).*" | grep -Pv "(^temp$)|(^history$)"').split(' ') -%} -branches: - saltmaster: - - a -{%- for branch in branches %} - - {{branch}} -{% endfor %}