diff --git a/README.md b/README.md index e7bf0b8..d0449bb 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,18 @@ - ansible all -m setup - ansible all -m setup -a 'filter=ansible_distribution*' - ansible all -m gather_facts -- ansible all -m gather_facts --limit root@49.13.21.211 \ No newline at end of file +- ansible all -m gather_facts --limit root@49.13.21.211 + +# Run Ansible Playbook Commmand +The similar command is used to update the cache on all hosts: + - sudo apt update + - ansible all -m apt -a update_cache=true --become --ask-become-pass +* -m: This is used to specify the module name +* -a: This is used to specify the arguments to the module +* Become: This is used to run the command as root user +* Ask-become-pass: This is used to ask for the password of the root user + +# Update Ubuntu Packages +- ansible all -m apt -a 'upgrade=dist update_cache=yes' --become --ask-become-pass +- ansible all -m apt -a 'upgrade=yes update_cache=yes' --become --ask-become-pass +- ansible all -m apt -a 'name=nginx state=latest' --become --ask-become-pass --limit root@49.13.21.211