📖 DOC: More Ansible Commands
This commit is contained in:
14
README.md
14
README.md
@@ -12,3 +12,17 @@
|
||||
- ansible all -m setup -a 'filter=ansible_distribution*'
|
||||
- ansible all -m gather_facts
|
||||
- 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
|
||||
|
||||
Reference in New Issue
Block a user