diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-01-19 21:14:51 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-01-19 21:14:51 +0100 |
commit | 9642cd7ae24f0ba79ce5647c709b35ae8f06a285 (patch) | |
tree | ae25c3b0db7ae4c23186b294c6d000073f085c2d /3 Resources/ansible/ad-hoc-commands.md | |
parent | 969b96c2531fb986f6c7f21fd544391b439defd7 (diff) |
vault backup: 2025-01-19 21:14:51
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 |