Variable types

Variables can be of different types, including the following:

  • Basic type variables, such as strings, integers, booleans, lists, and dictionaries.
  • Nested variables.
  • Null variables.
  • Magic variables.
  • Connection variables.
  • Facts.

Basic types

  • Strings: These variables are used to store and manipulate text-based data. Strings can be defined using single (' ') or double (" ") quotes. In the following example, we’re using the name variable to store the My name string value, the docker_version variable to store a string value of 20.10.14, and also the package_name variable to store the curl value:

Note: Simple strings without special characters or spaces do not have to be enclosed within quotes.

Get hands-on with 1400+ tech skills courses.