{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/14771","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/14771/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/14771/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/14771/events","html_url":"https://github.com/ansible/ansible/issues/14771","id":138161686,"number":14771,"title":"Using full st_mode results in difference in check-mode run and real run","user":{"login":"dagwieers","id":388198,"avatar_url":"https://avatars.githubusercontent.com/u/388198?v=3","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-03-03T12:18:18Z","updated_at":"2016-03-03T14:46:33Z","closed_at":null,"body":"##### Issue Type:\r\n\r\n<!--- Please pick one and delete the rest: -->\r\n - Bug Report\r\n\r\n##### Ansible Version:\r\nThe issue exists for both 1.9.4 and 2.0.1.0 (and likely any other Ansible version)\r\n\r\n##### Summary:\r\n\r\n<!--- Please explain the problem briefly -->\r\nWhen using (full)python permission modes, Ansible behaves differently in check-mode than it would during a real run.\r\n\r\nGranted, this is very unusual for someone to do (except programmatically), but we found it by accident and would prefer to see this fixed.\r\n\r\n##### Steps To Reproduce:\r\n\r\n<!---\r\nFor bugs, please show exactly how to reproduce the problem. For new\r\nfeatures, show how the feature would be used.\r\n-->\r\n\r\nWhen using mode='0100755' which is valid for a real run because Ansible handles it correctly, it fails during check-mode because it was not converted properly.\r\n```yaml\r\n- hosts: localhost\r\n  gather_facts: no\r\n  tasks:\r\n  - copy:\r\n      src: /etc/fstab\r\n      dest: /tmp/\r\n      mode: '0100755'\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### Expected Results:\r\n\r\n<!--- What did you expect to happen when running the steps above? -->\r\n```\r\n[dag@moria ansible.testing]$ ansible-playbook test71.yml\r\n\r\nPLAY ***************************************************************************\r\n\r\nTASK [copy] ********************************************************************\r\nok: [localhost]\r\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost                  : ok=1    changed=0    unreachable=0    failed=0   \r\n\r\n[dag@moria ansible.testing]$ ansible-playbook -CD test71.yml\r\n\r\nPLAY ***************************************************************************\r\n\r\nTASK [copy] ********************************************************************\r\nok: [localhost]\r\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost                  : ok=1    changed=0    unreachable=0    failed=0   \r\n```\r\n\r\n##### Actual Results:\r\n\r\n<!--- What actually happened? If possible run with high verbosity (-vvvv) -->\r\n\r\n```\r\n[dag@moria ansible.testing]$ ansible-playbook test71.yml\r\n\r\nPLAY ***************************************************************************\r\n\r\nTASK [copy] ********************************************************************\r\nok: [localhost]\r\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost                  : ok=1    changed=0    unreachable=0    failed=0   \r\n\r\n[dag@moria ansible.testing]$ ansible-playbook -CD test71.yml\r\n\r\nPLAY ***************************************************************************\r\n\r\nTASK [copy] ********************************************************************\r\nchanged: [localhost]\r\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost                  : ok=1    changed=1    unreachable=0    failed=0   \r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/191795843","html_url":"https://github.com/ansible/ansible/issues/14771#issuecomment-191795843","issue_url":"https://api.github.com/repos/ansible/ansible/issues/14771","id":191795843,"user":{"login":"bcoca","id":836171,"avatar_url":"https://avatars.githubusercontent.com/u/836171?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoca","html_url":"https://github.com/bcoca","followers_url":"https://api.github.com/users/bcoca/followers","following_url":"https://api.github.com/users/bcoca/following{/other_user}","gists_url":"https://api.github.com/users/bcoca/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoca/subscriptions","organizations_url":"https://api.github.com/users/bcoca/orgs","repos_url":"https://api.github.com/users/bcoca/repos","events_url":"https://api.github.com/users/bcoca/events{/privacy}","received_events_url":"https://api.github.com/users/bcoca/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T14:46:32Z","updated_at":"2016-03-03T14:46:32Z","body":"The first three numbers describe the type of filesystem object (file, directory, pipe, etc), its not something you should be trying to use chmod (what mode= is for), they should be ignored."}}