Ansible# 15 - Register in Variables Output from System Commands - register and Python List

Поделиться
HTML-код
  • Опубликовано: 28 сен 2024
  • Ansible provides ways to print results from system commands if they return any. Some results are almost always available such as Return Code or Exit Status.
    We see that the Ansible Adhoc command does nor require any extra code to print results from a command. However, when running a command from within an Ansible Playbook, we need to create a variable that can be used to store results.
    Watch this video to understand:
    - How to capture output and register it into a variable
    - How to use a Python List
    - How to apply a condition with the "when" statement to mark a task for execution or skip
    - How to use the "in" operator which is widely used in Python collections such as List and Dictionary

Комментарии •