Created
February 24, 2025 09:30
-
-
Save mschmitt/4c4db31224b8115073dc5e1bac7ee750 to your computer and use it in GitHub Desktop.
Ansible Hausaufgabenhilfe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ansible-playbook | |
--- | |
- hosts: localhost | |
gather_facts: true | |
connection: local | |
tasks: | |
- name: Do some things | |
block: | |
- name: A few non-invasive apt actions | |
apt: | |
name: | |
- bash | |
- openssl | |
register: result_one | |
- name: Some that might produce interesting output | |
shell: iptables -L; ip6tables -L | |
register: result_two | |
- name: Some other random thing, but it will fail | |
systemd_service: | |
name: dummy.service | |
enabled: false | |
register: result_three | |
always: | |
- name: Show results | |
debug: | |
var: item | |
with_items: | |
- "{{ result_one }}" | |
- "{{ result_two }}" | |
- "{{ result_three }}" | |
# vim: filetype=yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment