I have this text file and I was trying to delete some text that I had just added. Not sure how I would go about deleting
-
The entire text tree and the wrappers #BEGIN ANSIBLE MANAGED BLOCK
-
Just deleting the text tree
Can anyone explain? Thanks
The delete functionality is not functioning as expected
(ansible 2.3.0)
textfile -
giraffe
This is my text to add
Noooooooooooooo
penguin
robot
#BEGIN ANSIBLE MANAGED BLOCK
tree
#BEGIN ANSIBLE MANAGED BLOCK
Tried the following playbook and it just deleted the last wrapper
Playbook
- hosts: local
tasks:
- name: Use blockinfile
blockinfile:
path: /home/ansible/blockexample.txt
marker: “#BEGIN ANSIBLE MANAGED BLOCK”
block :
tree
state: absent
Outcome -