Categories

Category cover

Automation
155 posts

Category cover

Learning paths
119 posts

Category cover

CISO
22 posts

Category cover

Security
20 posts

Category cover

Notes
19 posts

Category cover

Personal Security
18 posts

Category cover

Infrastructure
12 posts

Category cover

OT/ICS
5 posts

Category cover

Books
3 posts

Category cover

UNetLab
3 posts

Category cover

Write-up
3 posts

Category cover

OSInt
2 posts

Category cover

My life
1 posts

Defining and using variables in Ansible

Andrea Dainese
September 01, 2024
Post cover

Variables in Ansible can be defined in various ways, offering flexibility in managing configuration and customizing playbooks.

Defining Variables in the Playbook: one simple and direct way to define variables is to include them directly in the playbook:

In this example, the variables ntp_server_1 and ntp_server_2 are defined within the playbook itself.

Defining Variables in a Configuration File: to keep playbooks cleaner and manage configuration separately, variables can be defined in an external file:

Continue reading the post on Patreon .