Outils pour utilisateurs

Outils du site


tuto:linux:saltstack

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tuto:linux:saltstack [2018/03/23 20:32] – [Définir une variable] roottuto:linux:saltstack [2019/07/29 17:54] (Version actuelle) – [Renderer en python] root
Ligne 1613: Ligne 1613:
 </note> </note>
  
 +===== Créer son propre module =====
 +https://docs.saltstack.com/en/latest/ref/modules/index.html
 +
 +===== Créer son propre state =====
 +https://docs.saltstack.com/en/latest/ref/states/writing.html
 +
 +===== Créer son propre grain =====
 +https://docs.saltstack.com/en/latest/topics/grains/#writing-grains
 +===== Client salt en python =====
 +https://docs.saltstack.com/en/latest/ref/clients/
 +
 +===== Renderer en python =====
 +https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.py.html
 +
 +===== Vars selon context =====
 +<code>
 +auth:
 +    - __path__ (path to your module dir)
 +
 +modules:
 +    - __pillar__
 +    - __salt__
 +    - __opts__
 +    - __context__ ({'systemd.sd_booted': True})
 +    - __grains__
 +
 +runners:
 +    - __pillar__
 +    - __salt__
 +    - __opts__
 +    - __grains__
 +
 +returners:
 +    - __salt__
 +    - __opts__
 +    - __pillar__
 +    - __grains__
 +
 +pillars:
 +    - __salt__ (modules)
 +    - __opts__
 +    - __pillar__
 +    - __grains__
 +
 +# nothing
 +tops:
 +    - ['__builtins__', '__file__', 'subprocess', 'yaml', '__name__', '__package__', '__doc__']
 +
 +outputters:
 +    - __opts__
 +    - __pillar__
 +    - __grains__
 +
 +states:
 +    - __pillar__
 +    - __low__ (lowstate structure?)
 +    - __env__
 +    - __running__
 +    - __lowstate__
 +    - __salt__
 +    - __opts__
 +    - __grains__
 +
 +log_handlers:
 +    - __path__
 +
 +renderers:
 +    - __salt__ - Execution functions (i.e. __salt__['test.echo']('foo'))
 +    - __grains__ - Grains (i.e. __grains__['os'])
 +    - __pillar__ - Pillar data (i.e. __pillar__['foo'])
 +    - __opts__ - Minion configuration options
 +    - __env__ - The effective salt fileserver environment (i.e. base). Also referred to as a "saltenv". __env__ should not be modified in a pure python SLS file. To use a different environment, the environment should be set when executing the state. This can be done in a couple different ways:
 +        Using the saltenv argument on the salt CLI (i.e. salt '*' state.sls foo.bar.baz saltenv=env_name).
 +        By adding a saltenv argument to an individual state within the SLS file. In other words, adding a line like this to the state's data structure: {'saltenv': 'env_name'}
 +    - __sls__ - The SLS path of the file. For example, if the root of the base environment is /srv/salt, and the SLS file is /srv/salt/foo/bar/baz.sls, then __sls__ in that file will be foo.bar.baz.
 +
 +grains:
 +    - __salt__
 +    - __opts__
 +    - __pillar__
 +    - __grains__
 +</code>
 ===== Debug ===== ===== Debug =====
   * Option debug (**-l debug**) :   * Option debug (**-l debug**) :
tuto/linux/saltstack.1521837158.txt.gz · Dernière modification : 2018/03/23 20:32 de root