Browse Source

feat(`tofs`): allow TOFS for minion configuration

tags/v0.58.0
Imran Iqbal 5 years ago
parent
commit
fbe814ace8
No account linked to committer's email address
7 changed files with 33 additions and 3 deletions
  1. +3
    -0
      pillar.example
  2. +1
    -0
      salt/defaults.yaml
  3. +4
    -0
      salt/files/default/minion.d/beacons.conf
  4. +4
    -0
      salt/files/default/minion.d/engine.conf
  5. +4
    -0
      salt/files/default/minion.d/f_defaults.conf
  6. +4
    -0
      salt/files/default/minion.d/reactor.conf
  7. +13
    -3
      salt/minion.sls

+ 3
- 0
pillar.example View File

# source_files: # source_files:
# salt-master: # salt-master:
# - 'alt_master.d' # - 'alt_master.d'
# salt-minion:
# - 'alt_minion.d'


# salt master config # salt master config
master_config_use_TOFS: True master_config_use_TOFS: True
- /srv/salt/reactors/deploy.sls - /srv/salt/reactors/deploy.sls


# salt minion config: # salt minion config:
minion_config_use_TOFS: True
minion: minion:


# single master setup # single master setup

+ 1
- 0
salt/defaults.yaml View File



minion_remove_config: False minion_remove_config: False
master_remove_config: False master_remove_config: False
minion_config_use_TOFS: False
master_config_use_TOFS: False master_config_use_TOFS: False


minion_service: salt-minion minion_service: salt-minion

+ 4
- 0
salt/files/default/minion.d/beacons.conf View File

########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################

+ 4
- 0
salt/files/default/minion.d/engine.conf View File

########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################

+ 4
- 0
salt/files/default/minion.d/f_defaults.conf View File

########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################

+ 4
- 0
salt/files/default/minion.d/reactor.conf View File

########################################################################
## File managed by Salt.
## Your changes will be overwritten.
########################################################################

+ 13
- 3
salt/minion.sls View File

{% from "salt/map.jinja" import salt_settings with context %}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import salt_settings with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}


{% if salt_settings.install_packages and grains.os == 'MacOS' and salt_settings.salt_minion_pkg_source != '' and salt_settings.version != '' %} {% if salt_settings.install_packages and grains.os == 'MacOS' and salt_settings.salt_minion_pkg_source != '' and salt_settings.version != '' %}
{# only download IF we know where to get the pkg from and if we know what version to check the current install (if installed) against #} {# only download IF we know where to get the pkg from and if we know what version to check the current install (if installed) against #}
{% endif %} {% endif %}
file.recurse: file.recurse:
- name: {{ salt_settings.config_path }}/minion.d - name: {{ salt_settings.config_path }}/minion.d
{%- if salt_settings.minion_config_use_TOFS %}
- template: ''
- source: {{ files_switch(['minion.d'],
lookup='salt-minion'
)
}}
{%- else %}
- template: jinja - template: jinja
- source: salt://{{ slspath }}/files/minion.d - source: salt://{{ slspath }}/files/minion.d
- clean: {{ salt_settings.clean_config_d_dir }}
- exclude_pat: _*
- context: - context:
standalone: False standalone: False
{%- endif %}
- clean: {{ salt_settings.clean_config_d_dir }}
- exclude_pat: _*
service.running: service.running:
- enable: True - enable: True
- name: {{ salt_settings.minion_service }} - name: {{ salt_settings.minion_service }}

Loading…
Cancel
Save