Teil 11 Loops

This commit is contained in:
2025-07-16 13:59:07 +02:00
parent 9621d1d1d4
commit a9f3b8347f
9 changed files with 84 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
- include: ../subtasks/setuploop.yml
- name: erzeuge Testdateien
ansible.builtin.file:
path: "test/{{ item }}"
state: touch
loop: "{{ testfiles }}"

View File

@@ -0,0 +1,21 @@
- include: ../subtasks/setuploop.yml
- name: erzeuge test1.txt
ansible.builtin.file:
path: "test/test1.txt"
state: touch
- name: erzeuge test1.json
ansible.builtin.file:
path: "test/test1.json"
state: touch
- name: erzeuge test2.txt
ansible.builtin.file:
path: "test/test2.txt"
state: touch
- name: erzeuge test3.txt
ansible.builtin.file:
path: "test/test3.txt"
state: touch
- name: erzeuge testr4.dat
ansible.builtin.file:
path: "test/test4.dat"
state: touch

View File

@@ -0,0 +1,10 @@
---
- name: create test dir
ansible.builtin.file:
path: test
state: directory
- name: delete test files
ansible.builtin.file:
path: "test/*"
state: absent

View File

@@ -0,0 +1,13 @@
- include: ../subtasks/setuploop.yml
- name: erzeuge Testdateien
ansible.builtin.file:
path: "test/{{ item }}"
state: touch
with_items:
- test1.txt
- test1.json
- test2.txt
- test3.txt
- test4.dat