From ed0753ad224f0c65133bd7a63180257eecd9f5e3 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Wed, 8 Jan 2025 10:48:09 +0100 Subject: vault backup: 2025-01-08 10:48:09 --- .trash/3 resources/ansible/ad-hoc-commands.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .trash/3 resources/ansible/ad-hoc-commands.md (limited to '.trash/3 resources/ansible/ad-hoc-commands.md') diff --git a/.trash/3 resources/ansible/ad-hoc-commands.md b/.trash/3 resources/ansible/ad-hoc-commands.md new file mode 100644 index 0000000..eda1265 --- /dev/null +++ b/.trash/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 -m ansible.builtin.apt -a "update_cache=true cache_valid_time=3600" +``` + +update packages: +``` +ansible -m ansible.builtin.apt -a "name=* state=latest" +``` + +run puppet: +``` +ansible -a "/opt/puppetlabs/bin/puppet agent --test" +``` + +reboot: +``` +ansible -m ansible.builtin.reboot -f 1 +``` + +[[ansible]] +#ansible \ No newline at end of file -- cgit v1.2.3