Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

stat.exists regression #5115

Closed
php-coder opened this issue Sep 30, 2016 · 7 comments
Closed

stat.exists regression #5115

php-coder opened this issue Sep 30, 2016 · 7 comments

Comments

@php-coder
Copy link

ISSUE TYPE
  • Bug Report
COMPONENT NAME

stat

ANSIBLE VERSION
2.1.2.0
OS / ENVIRONMENT

Travis CI

SUMMARY

My playbook that tries to check whether file exists or not started to fails with ansible 2.1.2.0 release. It worked on 2.1.1.0 version.

STEPS TO REPRODUCE
  - name: Getting info about WAR file
    stat:
      path: 'target/mystamps.war'
      get_checksum: no
      get_md5: no
    register: war_file
    become: no
    delegate_to: 127.0.0.1

  - name: Ensuring that WAR file exists
    assert:
      that:
        war_file.stat.exists
    become: no
    delegate_to: 127.0.0.1
EXPECTED RESULTS
TASK [Getting info about WAR file] *********************************************
ok: [my-stamps.ru -> 127.0.0.1]
TASK [Ensuring that WAR file exists] *******************************************
ok: [my-stamps.ru -> 127.0.0.1]
ACTUAL RESULTS
TASK [Getting info about WAR file] *********************************************
ok: [my-stamps.ru -> 127.0.0.1]
TASK [Ensuring that WAR file exists] *******************************************
fatal: [my-stamps.ru -> 127.0.0.1]: FAILED! => {"assertion": "war_file.stat.exists", "changed": false, "evaluated_to": false, "failed": true}
@ansibot
Copy link

ansibot commented Sep 30, 2016

@bpennypacker ping, this issue is waiting for your response.
click here for bot help

@ansibot
Copy link

ansibot commented Oct 16, 2016

@bpennypacker, ping. This issue is still waiting on your response.
click here for bot help

2 similar comments
@ansibot
Copy link

ansibot commented Oct 31, 2016

@bpennypacker, ping. This issue is still waiting on your response.
click here for bot help

@ansibot
Copy link

ansibot commented Nov 15, 2016

@bpennypacker, ping. This issue is still waiting on your response.
click here for bot help

@ansibot
Copy link

ansibot commented Dec 7, 2016

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

@php-coder
Copy link
Author

The problem still here with 2.3.0.0:

TASK [Getting info about WAR file] *********************************************
ok: [my-stamps.ru -> 127.0.0.1]

TASK [debug] *******************************************************************
ok: [my-stamps.ru] => {
    "changed": false, 
    "war_file": {
        "changed": false, 
        "stat": {
            "exists": false
        }
    }
}

TASK [Ensuring that WAR file exists] *******************************************
fatal: [my-stamps.ru -> 127.0.0.1]: FAILED! => {
    "assertion": "war_file.stat.exists", 
    "changed": false, 
    "evaluated_to": false, 
    "failed": true
}

At the same time, in 2.1.1.0 version it outputs:

TASK [Getting info about WAR file] *********************************************
ok: [my-stamps.ru -> 127.0.0.1]

TASK [debug] *******************************************************************
ok: [my-stamps.ru] => {
    "war_file": {
        "changed": false, 
        "stat": {
            "atime": 1494681212.4818838, 
            "ctime": 1494681212.9578838, 
            "dev": 2049, 
            "exists": true, 
            "gid": 1000, 
            "gr_name": "travis", 
            "inode": 923657, 
            "isblk": false, 
            "ischr": false, 
            "isdir": false, 
            "isfifo": false, 
            "isgid": false, 
            "islnk": false, 
            "isreg": true, 
            "issock": false, 
            "isuid": false, 
            "mode": "0664", 
            "mtime": 1494681212.9578838, 
            "nlink": 1, 
            "path": "target/mystamps.war", 
            "pw_name": "travis", 
            "rgrp": true, 
            "roth": true, 
            "rusr": true, 
            "size": 23217500, 
            "uid": 1000, 
            "wgrp": true, 
            "woth": false, 
            "wusr": true, 
            "xgrp": false, 
            "xoth": false, 
            "xusr": false
        }
    }
}

TASK [Ensuring that WAR file exists] *******************************************
ok: [my-stamps.ru -> 127.0.0.1]

@ansibot
Copy link

ansibot commented Sep 11, 2017

This issue was migrated to ansible/ansible#29618

@ansibot ansibot closed this as completed Sep 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants