tuto:linux:saltstack
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tuto:linux:saltstack [2018/03/04 20:34] – [Macro] root | tuto:linux:saltstack [2019/07/29 17:54] (Version actuelle) – [Renderer en python] root | ||
|---|---|---|---|
| Ligne 8: | Ligne 8: | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| ===== Configurer le master ===== | ===== Configurer le master ===== | ||
| < | < | ||
| Ligne 211: | Ligne 211: | ||
| </ | </ | ||
| - | ===== structure | + | ===== Structure |
| <code yaml> | <code yaml> | ||
| <Include Declaration>: | <Include Declaration>: | ||
| Ligne 361: | Ligne 361: | ||
| </ | </ | ||
| - | ===== targeting | + | ===== Targeting |
| https:// | https:// | ||
| * globbing sur le nom des minions : | * globbing sur le nom des minions : | ||
| Ligne 577: | Ligne 577: | ||
| </ | </ | ||
| + | |||
| + | < | ||
| + | {% set name = { | ||
| + | ' | ||
| + | ' | ||
| + | }.get(grains.os_family) %} | ||
| + | </ | ||
| ===== Executer un module ===== | ===== Executer un module ===== | ||
| * Appeler un module : | * Appeler un module : | ||
| Ligne 1188: | Ligne 1195: | ||
| **salt-run** est toujours lancé à partir du master ! | **salt-run** est toujours lancé à partir du master ! | ||
| </ | </ | ||
| + | |||
| + | ==== manage ==== | ||
| + | * Status des minions : | ||
| + | < | ||
| + | $ salt-run manage.status | ||
| + | down: | ||
| + | - portable.localdomain | ||
| + | up: | ||
| + | </ | ||
| + | |||
| + | * Minions down : | ||
| + | < | ||
| + | $ salt-run manage.down | ||
| + | - portable.localdomain | ||
| + | </ | ||
| + | |||
| + | * Minions up : | ||
| + | < | ||
| + | $ salt-run manage.up | ||
| + | - portable.localdomain | ||
| + | </ | ||
| + | |||
| + | * Version du client salstack des minions : | ||
| + | < | ||
| + | $ salt-run manage.versions | ||
| + | Master: | ||
| + | 2017.7.3 | ||
| + | Up to date: | ||
| + | ---------- | ||
| + | portable.localdomain: | ||
| + | 2017.7.3 | ||
| + | </ | ||
| ==== orchestrate ==== | ==== orchestrate ==== | ||
| <code yaml> | <code yaml> | ||
| Ligne 1546: | Ligne 1585: | ||
| </ | </ | ||
| + | ===== Gestion des environnements avec gitfs ===== | ||
| + | Editer le fichier de configuration ''/ | ||
| + | < | ||
| + | top_file_merging_strategy: | ||
| + | state_top_saltenv: | ||
| + | |||
| + | fileserver_backend: | ||
| + | #- roots | ||
| + | - git | ||
| + | |||
| + | gitfs_provider: | ||
| + | |||
| + | gitfs_remotes: | ||
| + | - https:// | ||
| + | </ | ||
| + | |||
| + | **roots** correspond aux **file_roots**. | ||
| + | |||
| + | Chaque tag ou branche est accessible avec saltenv : | ||
| + | < | ||
| + | $ salt ' | ||
| + | $ salt ' | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | La branche **master** correspond au saltenv **base** ! | ||
| + | </ | ||
| + | |||
| + | ===== Créer son propre module ===== | ||
| + | https:// | ||
| + | |||
| + | ===== Créer son propre state ===== | ||
| + | https:// | ||
| + | |||
| + | ===== Créer son propre grain ===== | ||
| + | https:// | ||
| + | ===== Client salt en python ===== | ||
| + | https:// | ||
| + | |||
| + | ===== Renderer en python ===== | ||
| + | https:// | ||
| + | |||
| + | ===== Vars selon context ===== | ||
| + | < | ||
| + | auth: | ||
| + | - __path__ (path to your module dir) | ||
| + | |||
| + | modules: | ||
| + | - __pillar__ | ||
| + | - __salt__ | ||
| + | - __opts__ | ||
| + | - __context__ ({' | ||
| + | - __grains__ | ||
| + | |||
| + | runners: | ||
| + | - __pillar__ | ||
| + | - __salt__ | ||
| + | - __opts__ | ||
| + | - __grains__ | ||
| + | |||
| + | returners: | ||
| + | - __salt__ | ||
| + | - __opts__ | ||
| + | - __pillar__ | ||
| + | - __grains__ | ||
| + | |||
| + | pillars: | ||
| + | - __salt__ (modules) | ||
| + | - __opts__ | ||
| + | - __pillar__ | ||
| + | - __grains__ | ||
| + | |||
| + | # nothing | ||
| + | tops: | ||
| + | - [' | ||
| + | |||
| + | 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__[' | ||
| + | - __grains__ - Grains (i.e. __grains__[' | ||
| + | - __pillar__ - Pillar data (i.e. __pillar__[' | ||
| + | - __opts__ - Minion configuration options | ||
| + | - __env__ - The effective salt fileserver environment (i.e. base). Also referred to as a " | ||
| + | Using the saltenv argument on the salt CLI (i.e. salt ' | ||
| + | By adding a saltenv argument to an individual state within the SLS file. In other words, adding a line like this to the state' | ||
| + | - __sls__ - The SLS path of the file. For example, if the root of the base environment is /srv/salt, and the SLS file is / | ||
| + | |||
| + | grains: | ||
| + | - __salt__ | ||
| + | - __opts__ | ||
| + | - __pillar__ | ||
| + | - __grains__ | ||
| + | </ | ||
| ===== Debug ===== | ===== Debug ===== | ||
| * Option debug (**-l debug**) : | * Option debug (**-l debug**) : | ||
tuto/linux/saltstack.1520195682.txt.gz · Dernière modification : de root
