Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: reset test file
- copy:
- content: |
- [section1]
- foo=bar
- [section2]
- bar=foo
- [section3]
- haha=hoho
- dest: /tmp/foo.ini
- - name: remove section
- ini_file:
- path: /tmp/foo.ini
- section: "section2"
- state: absent
- - name: remove section again
- ini_file:
- path: /tmp/foo.ini
- section: "section2"
- state: absent
- - name: remove section again w. loop
- ini_file:
- path: /tmp/foo.ini
- section: "{{ item.section }}"
- state: absent
- with_items:
- - { section: "section2" }
Advertisement
Add Comment
Please, Sign In to add comment