From e4fe3a92a8da96894248e9633c08c636cc28099e Mon Sep 17 00:00:00 2001 From: Actaeus Curabitur Date: Thu, 8 Sep 2022 06:45:04 -0500 Subject: [PATCH] updated saltmaster configuration --- states/roles/maintain/saltmaster/init.sls | 2 ++ states/roles/maintain/saltmaster/master | 30 +++++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/states/roles/maintain/saltmaster/init.sls b/states/roles/maintain/saltmaster/init.sls index bab7e93..b780236 100644 --- a/states/roles/maintain/saltmaster/init.sls +++ b/states/roles/maintain/saltmaster/init.sls @@ -1,3 +1,4 @@ +{%- set os=grains['os'] -%} salt-master: {%- if os=="CentOS" or os=="RedHat" %} pkg.installed: [] @@ -17,6 +18,7 @@ salt-master: - user: root - group: root - mode: 644 + - template: jinja /srv/salt/prod/states/pillars: file.symlink: diff --git a/states/roles/maintain/saltmaster/master b/states/roles/maintain/saltmaster/master index 45bce57..3d6caa3 100644 --- a/states/roles/maintain/saltmaster/master +++ b/states/roles/maintain/saltmaster/master @@ -422,12 +422,14 @@ state_output: terse # - /srv/salt/prod/states # file_roots: - base: - - /srv/salt/prod/states - prod: - - /srv/salt/prod/states - dev: - - /srv/salt/dev/states +{%- if pillar['branches'] is defined -%} +{%- if pillar['branches']['saltmaster'] is defined -%} +{%- for branch in pillar['branches']['saltmaster'] %} + {{branch}}: + - /srv/salt/{{branch}}/states +{%- endfor %} +{%- endif %} +{%- endif %} # # When using multiple environments, each with their own top file, the @@ -439,7 +441,7 @@ file_roots: # To specify the order in which environments are merged, set the ordering # in the env_order option. Given a conflict, the last matching value will # win. -env_order: ['base', 'dev', 'prod'] +env_order: ['qual', 'prod'] # If top_file_merging_strategy is set to 'same' and an environment does not # contain a top file, the top file in the environment specified by default_top @@ -560,12 +562,14 @@ hash_type: sha256 # - /srv/pillar # pillar_roots: - base: - - /srv/salt/prod/pillars - prod: - - /srv/salt/prod/pillars - dev: - - /srv/salt/dev/pillars +{%- if pillar['branches'] is defined -%} +{%- if pillar['branches']['saltmaster'] is defined -%} +{%- for branch in pillar['branches']['saltmaster'] %} + {{branch}}: + - /srv/salt/{{branch}}/pillars +{%- endfor %} +{%- endif %} +{%- endif %} # #ext_pillar: # - hiera: /etc/hiera.yaml