diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-01-08 10:48:09 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-01-08 10:48:09 +0100 |
commit | ed0753ad224f0c65133bd7a63180257eecd9f5e3 (patch) | |
tree | cc662868574fe17db58be9e0faadd452c84dc59c /3 resources/ansible/ad-hoc-commands.md | |
parent | 493be30dc981eaf762a95a1218f96893b1976727 (diff) |
vault backup: 2025-01-08 10:48:09
Diffstat (limited to '3 resources/ansible/ad-hoc-commands.md')
-rw-r--r-- | 3 resources/ansible/ad-hoc-commands.md | 25 |
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 |