From f5f99288eadee49d413fc1948891047c6f51ba34 Mon Sep 17 00:00:00 2001 From: Yuri Lima Date: Sun, 20 Aug 2023 02:40:20 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20DOC:=20More=20Ansible=20Commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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