-
Notifications
You must be signed in to change notification settings - Fork 0
ansible playbook arguments
Mohit edited this page Aug 9, 2017
·
1 revision
ansible-playbook <your-playbook-filename>.yml -i ./hosts
The above command will run the playbook on all the hosts mentioned in the hosts file.
- To see all the hosts that will be modified, pass the flag
list-hosts
- To perform dry run, you can also pass --check flag.
ansible-playbook playbook.yml -i ./hosts --remote-user=mohitsharma44
This will run the playbook as mohitsharma44
user.
If the user needs to run plays with elevated privileges, you can pass
--sudo
and--sudo-user=...
and--ask-sudo-pass