docs:tips_n_tricks:ansible:shell.html
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
docs:tips_n_tricks:ansible:shell.html [25.11.2023 15:36 CET] – peter | docs:tips_n_tricks:ansible:shell.html [25.11.2023 15:45 CET] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Ansible - shell scripts ====== | ====== Ansible - shell scripts ====== | ||
- | ===== Task Template | + | ===== Task template |
<note tip>This template assumes, that " | <note tip>This template assumes, that " | ||
<code yaml roles/ | <code yaml roles/ | ||
- | - name: You name it | + | - name: Shell scriptlet |
shell: | | shell: | | ||
if echo "Fake check for need of change - always true" | if echo "Fake check for need of change - always true" | ||
Line 18: | Line 18: | ||
failed_when: | failed_when: | ||
</ | </ | ||
- | ===== Task Template | + | ===== Task template |
This might be useful when using a script to gather information about the target host | This might be useful when using a script to gather information about the target host | ||
- | <code yaml roles/ | + | <code yaml roles/ |
- | - name: You name it | + | - name: Collect information |
shell: | | shell: | | ||
- | echo ' | + | echo ' |
check_mode: False | check_mode: False | ||
register: last_result | register: last_result |
docs/tips_n_tricks/ansible/shell.html.txt · Last modified: 25.11.2023 15:45 CET by peter