tech:notes_ansible_plugins
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:notes_ansible_plugins [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:notes_ansible_plugins [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Ansible plugins | ||
| + | |||
| + | Créer ses plugins | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ## Hello world | ||
| + | |||
| + | Plugin simple en bash et dans un rôle | ||
| + | |||
| + | `play-test-plugin.yml` | ||
| + | ~~~yaml | ||
| + | #! / | ||
| + | |||
| + | - name: test plugin | ||
| + | hosts: localhost | ||
| + | |||
| + | roles: | ||
| + | - plugin | ||
| + | - hello | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `roles/ | ||
| + | ~~~bash | ||
| + | #! /bin/bash | ||
| + | |||
| + | display=" | ||
| + | echo -e " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `roles/ | ||
| + | ~~~yaml | ||
| + | --- | ||
| + | |||
| + | - name: test plugin plug1 | ||
| + | plug1: | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ./ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Tester un module | ||
| + | |||
| + | ~~~bash | ||
| + | echo -e '{ " | ||
| + | |||
| + | echo -e '{ " | ||
| + | ~~~ | ||
| + | |||
| + | |||
