What are the most useful options for ad-hoc and playbook runs (`-b`, `-K`, `-u`, `-f`, `-e`)?
BeginnerConceptAd-hoc Commands, Modules and Idempotency
Answer
-b/--become— escalate privileges (sudo by default)-K— prompt for the become password-u user— remote user;-kasks for the SSH password-f N— forks, number of hosts handled in parallel (default 5)-e "k=v"or-e @vars.yml— extra variables (highest precedence)-iinventory,-llimit,-ttags,-vverbosity
ansible web -i inventory/ -b -u ubuntu -f 20 -m apt -a "upgrade=dist"
More on Ad-hoc Commands, Modules and Idempotency
What is an ad-hoc command and what is its syntax?BeginnerWhat does `ansible all -m ping` actually test?BeginnerGive practical use cases for ad-hoc commands.IntermediateWhat is the difference between the `command` and `shell` modules?BeginnerCompare `raw`, `command`, `shell` and `script`.IntermediateWhy prefer a dedicated module over `shell`/`command`?Beginner