Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] template with force=no reports changed in check mode #12844

Closed
resmo opened this issue Oct 20, 2015 · 1 comment
Closed

[v2] template with force=no reports changed in check mode #12844

resmo opened this issue Oct 20, 2015 · 1 comment
Labels
bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release
Milestone

Comments

@resmo
Copy link
Contributor

resmo commented Oct 20, 2015

Issue Type:
  • Bug Report
Ansible Version:
  • 1.9.4
  • 2.0.0 (devel b46ce47) last updated 2015/10/20 20:10:50 (GMT +200)
Summary:

In live mode a task with template and force=no would not overwrite an existing file and reports ok, but when running in check_mode it reports changed.

Steps To Reproduce:
$ cat test.yml 

---
- hosts: localhost
  tasks:
  - template: src=/etc/hosts dest=/etc/hostname force=no
ansible-playbook test.yml      

PLAY ***************************************************************************

TASK [template dest=/etc/hostname src=/etc/hosts force=no] *********************
ok: [localhost]

PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0   
$  ansible-playbook test.yml --check

PLAY ***************************************************************************

TASK [template dest=/etc/hostname src=/etc/hosts force=no] *********************
changed: [localhost]

PLAY RECAP *********************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0  
Expected Results:

reports ok in both cases.

Actual Results:

not reports ok in both cases.

@jimi-c jimi-c added bug_report P2 Priority 2 - Issue Blocks Release labels Oct 20, 2015
@jimi-c jimi-c added this to the v2 milestone Oct 20, 2015
@jimi-c jimi-c closed this as completed in 4b20884 Oct 21, 2015
@jimi-c
Copy link
Member

jimi-c commented Oct 21, 2015

Closing This Ticket

Hi!

We believe the above commit should resolve this problem for you. This will also be included in the next major release.

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved.

Thank you!

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release
Projects
None yet
Development

No branches or pull requests

3 participants