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

1) The entire text tree and the wrappers #BEGIN ANSIBLE MANAGED BLOCK

2) 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 - 

giraffe
This is my text to add
Noooooooooooooo
penguin
robot

#BEGIN ANSIBLE MANAGED BLOCK
tree





-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e4caf844-d18c-4f22-b561-09c8bd6d2c60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to