Kagee

Untitled

Feb 4th, 2022
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. - name: reset test file
  2. copy:
  3. content: |
  4. [section1]
  5. foo=bar
  6.  
  7. [section2]
  8. bar=foo
  9.  
  10. [section3]
  11. haha=hoho
  12. dest: /tmp/foo.ini
  13.  
  14. - name: remove section
  15. ini_file:
  16. path: /tmp/foo.ini
  17. section: "section2"
  18. state: absent
  19.  
  20. - name: remove section again
  21. ini_file:
  22. path: /tmp/foo.ini
  23. section: "section2"
  24. state: absent
  25.  
  26. - name: remove section again w. loop
  27. ini_file:
  28. path: /tmp/foo.ini
  29. section: "{{ item.section }}"
  30. state: absent
  31. with_items:
  32. - { section: "section2" }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment