Get Priveledge

Use the --become or -b method to gain priviledge.

 ansible -i inventory.yml server -m ping --become

If your system needs a password to authenticate, we can use the -K or --ask-become-pass and type in your sudo password via tty.

 ansible -i inventory.yml server -m ping --ask-become-pass