O'Reilly logo

Ansible Configuration Management - Second Edition by Daniel Hall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The variable section

Here, we can define variables that apply to the entire play on all machines. We can also make Ansible prompt for variables if they weren't supplied on the command line. This allows us to make easily maintainable plays, and prevents us from changing the same thing in several parts of the play. This also allows us to have the entire configuration for the play stored at the top, where we can easily read and modify it without worrying about what the rest of the play does.

Variables in this section of a play can be overridden by machine facts (those that are set by modules), but they themselves override the facts we set in our inventory. So they are useful to define defaults that we might collect in a module later, but they can't ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required