summaryrefslogtreecommitdiff
path: root/3 resources/ansible/ad-hoc-commands.md
diff options
context:
space:
mode:
Diffstat (limited to '3 resources/ansible/ad-hoc-commands.md')
-rw-r--r--3 resources/ansible/ad-hoc-commands.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/3 resources/ansible/ad-hoc-commands.md b/3 resources/ansible/ad-hoc-commands.md
new file mode 100644
index 0000000..eda1265
--- /dev/null
+++ b/3 resources/ansible/ad-hoc-commands.md
@@ -0,0 +1,25 @@
+Using ansible we can perform ad-hoc commands, useful for a one-off thing that won't require writing a full playbook.
+
+Some examples include:
+update apt cache:
+```
+ansible <pattern> -m ansible.builtin.apt -a "update_cache=true cache_valid_time=3600"
+```
+
+update packages:
+```
+ansible <pattern> -m ansible.builtin.apt -a "name=* state=latest"
+```
+
+run puppet:
+```
+ansible <pattern> -a "/opt/puppetlabs/bin/puppet agent --test"
+```
+
+reboot:
+```
+ansible <pattern> -m ansible.builtin.reboot -f 1
+```
+
+[[ansible]]
+#ansible \ No newline at end of file