On 08. aug. 2016 18:56, Anushri Mishra wrote:
so this is what I have in my yml file:

-   name: Copy War File

    copy: src=externaluserwebapi.war dest=/usr/share/tomcat7/webapps

    become: True

    become_method: sudo

and this is what I get when I run playbook:

ok: [10.1.33.227] => {"changed": false, "checksum":
"c93572d33bd0555a87341380ac389382c225a92d", "dest":
"/usr/share/tomcat7/webapps/externaluserwebapi.war", "gid": 0, "group":
"root", "invocation": {"module_args": {"backup": false, "content": null,
"delimiter": null, "dest":
"/usr/share/tomcat7/webapps/externaluserwebapi.war", "directory_mode":
null, "follow": false, "force": true, "group": null, "mode": null,
"original_basename": "externaluserwebapi.war", "owner": null, "regexp":
null, "remote_src": null, "selevel": null, "serole": null, "setype": null,
"seuser": null, "src":
"/home/ec2-user/.ansible/tmp/ansible-tmp-1470673998.42-22221732776252/source",
"validate": null}}, "md5sum": "ba5224fb84a5f82d5fa7b8a8f83c4b2e", "mode":
"0644", "owner": "root", "size": 17027813, "src":
"/home/ec2-user/.ansible/tmp/ansible-tmp-1470673998.42-22221732776252/source",
"state": "file", "uid": 0}

Not sure why but copy module is not overriding the script in destination
directory.I read that by default it is force=yes.Please help.

The reason is because the files is identical.

To debug you could add this tasks.

Add this two task before "Copy War File"
- stat:
    path=externaluserwebapi.war
  delegate_to: localhost
  register: result

- debug: var=result

and add this two task after "Copy War File"
- stat:
    path=/usr/share/tomcat7/webapps
  register: result

- debug: var=result

--
Kai Stian Olstad

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/171a9eea-5630-02f4-930f-337ce3359109%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to