*Playbook*
I am trying to chnage some test in a property file using "lineinfile" 
module.  I am getting the below exception. 
On my host, there is a sudo user (testuser). sudo method is "sudo su - 
testuser"


--- 
- 
  hosts: Test
  
  tasks: 
    
   - name: change files
     become: yes
     become_method: sudo su
     become_user: testuser
     lineinfile:
       path: /path/test.properties
       regexp: '^test1234'
       line: '1234test1234'
       owner: root
       group: root
       mode: 01777
       backup: yes
       
*Error Output:*

{"changed": false, "gid": 63243, "group": "testuser", "mode": "0777", 
"msg": "chown failed: [Errno 1] Operation not permitted: 
'/path/test.properties'", "owner": "testuser", "path": 
"/path/test.properties", "secontext": 
"unconfined_u:object_r:unlabeled_t:s0", "size": 2222, "state": "file", 
"uid": 29604}

-- 
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/f7c2b156-8c38-43ec-a568-ed8e4fc3777a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to