How to use Ansible variables from the command line

preview_player
Показать описание
Make you Playbook more usable by adding in variables that can be populated form the command line. We look at creating users in Ansible 2.9.4 on the Raspberry Pi showing the use of variables and the option -e the ansible-playbook. No longer do we need to hard-code the user name into the playbook. Taking this approach we can also have 2 tasks one to create the user and one to delete the user and using the when clause to determine the state of another variable
Рекомендации по теме
Комментарии
Автор

Thank you Andrew M. Patiently waiting for the full RHCE8 course.

arrey
Автор

Hi Andrew, can we put multiple values for the same variable (and run it through a loop using the with_items clause in the playbook) on the command line itself ?

sketchyankityadav