Hi James,

 Thank you so much for your help, its working perfect.

 ---
 - hosts: testuser
   become: yes
   tasks:
   - name: removelines
     blockinfile:
       marker: "{mark}"
       block: |

               ################ request ###################
               User_Alias      S3_OPS=pams3fedqaadmin
               S3_OPS          ALL=(ALL)       ALL
               ####################################################"
       path: /tmp/test
       state: absent
       backup: yes 

Thanks,
Deepan M

On Friday, February 15, 2019 at 5:55:48 PM UTC+5:30, Deepan M wrote:
>
>
> please someone help me to get answer for my query!
>
> ---
> - hosts: testuser
>   become: yes
>   tasks:
>   - name: removelines
>     blockinfile:
>       block: |
>
>               ################ request ###################
>               User_Alias      S3_OPS=pams3fedqaadmin
>               S3_OPS          ALL=(ALL)       ALL
>               ####################################################"
>       path: /tmp/test
>       state: absent
>       backup: yes
>
>
>  ansible-playbook sudolineinfile.yml
> SUDO password:
>
> PLAY [xerox] 
> *************************************************************************************************************************
>
> TASK [Gathering Facts] 
> ***************************************************************************************************************
> ok: [usamachine]
>
> TASK [removelines] 
> *******************************************************************************************************************
> ok: [usamachine]
>
> PLAY RECAP 
> ***************************************************************************************************************************
> usamachine              : ok=2    changed=0    unreachable=0    failed=0
>
>
>

-- 
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/c2cc6922-8a20-4404-bcdf-825ca3315679%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to