Forrest logo
back to the ansible-playbook tool

ansible-playbook:tldr:47c2a

ansible-playbook: Run tasks in playbook with extra variables defined in a JSON file.
$ ansible-playbook ${playbook} -e "@${variables-json}"
try on your machine

This command is used to run an Ansible playbook with specified variables in a JSON file.

Here's a breakdown of the command:

  • ansible-playbook: It is the command for executing an Ansible playbook.
  • ${playbook}: This is a placeholder for the name or path of the playbook YAML file. Replace ${playbook} with the actual name or path of the playbook you want to execute.
  • -e: This option is used to pass extra variables to the playbook. In this command, it is specifying that variables will be provided via a JSON file.
  • @${variables-json}: This is referring to a JSON file that contains the variables you want to use in the playbook. Replace ${variables-json} with the name or path of the JSON file.

Overall, this command executes the specified Ansible playbook and provides additional variables from the JSON file to be used within the playbook.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ansible-playbook tool