瀏覽代碼

Add a “salt.standalone” state

tags/v0.57.0
Raphaël Hertzog 10 年之前
父節點
當前提交
b93ec22244
共有 4 個檔案被更改,包括 30 行新增0 行删除
  1. +6
    -0
      README.rst
  2. +4
    -0
      salt/files/minion.d/_defaults.conf
  3. +2
    -0
      salt/minion.sls
  4. +18
    -0
      salt/standalone.sls

+ 6
- 0
README.rst 查看文件

Install salt-ssh with roster file. Install salt-ssh with roster file.
Configure pillar data under salt:ssh_roster to feed the template. Configure pillar data under salt:ssh_roster to feed the template.


``salt.standalone``
------------

Install a minion and configure it in `standalone mode
<docs.saltstack.com/en/latest/topics/tutorials/standalone_minion.html>`_.

``Configuration`` ``Configuration``
================= =================
Every option available in the templates can be set in pillar. Settings under 'salt' will be overridden by more specific settings under ``salt['master']``, ``salt['minion']`` or ``salt['cloud']`` Every option available in the templates can be set in pillar. Settings under 'salt' will be overridden by more specific settings under ``salt['master']``, ``salt['minion']`` or ``salt['cloud']``

+ 4
- 0
salt/files/minion.d/_defaults.conf 查看文件

# Set the file client. The client defaults to looking on the master server for # Set the file client. The client defaults to looking on the master server for
# files, but can be directed to look at the local file directory setting # files, but can be directed to look at the local file directory setting
# defined below by setting it to local. # defined below by setting it to local.
{%- if standalone %}
file_client: local
{%- else %}
{{ get_config('file_client', 'remote') }} {{ get_config('file_client', 'remote') }}
{%- endif %}


# The file directory works on environments passed to the minion, each environment # The file directory works on environments passed to the minion, each environment
# can have multiple root directories, the subdirectories in the multiple file # can have multiple root directories, the subdirectories in the multiple file

+ 2
- 0
salt/minion.sls 查看文件

- template: jinja - template: jinja
- source: salt://salt/files/minion.d - source: salt://salt/files/minion.d
- clean: True - clean: True
- context:
standalone: False
service.running: service.running:
- enable: True - enable: True
- name: {{ pkgs.get('minion-service', 'salt-minion') }} - name: {{ pkgs.get('minion-service', 'salt-minion') }}

+ 18
- 0
salt/standalone.sls 查看文件

{% from "salt/package-map.jinja" import pkgs with context %}

salt-minion:
pkg.installed:
- name: {{ pkgs['salt-minion'] }}
file.recurse:
- name: {{ pkgs.get('config-path', '/etc/salt') }}/minion.d
- template: jinja
- source: salt://salt/files/minion.d
- clean: True
- context:
standalone: True
service.dead:
- enable: False
- name: {{ pkgs.get('minion-service', 'salt-minion') }}
- require:
- pkg: salt-minion
- file: salt-minion

Loading…
取消
儲存