{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4194","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4194/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4194/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4194/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/4194","id":165801534,"number":4194,"title":"`apt_repository` module cannot upgrade permission mode of related `.list` file","user":{"login":"jangsutsr","id":14990293,"avatar_url":"https://avatars.githubusercontent.com/u/14990293?v=3","gravatar_id":"","url":"https://api.github.com/users/jangsutsr","html_url":"https://github.com/jangsutsr","followers_url":"https://api.github.com/users/jangsutsr/followers","following_url":"https://api.github.com/users/jangsutsr/following{/other_user}","gists_url":"https://api.github.com/users/jangsutsr/gists{/gist_id}","starred_url":"https://api.github.com/users/jangsutsr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jangsutsr/subscriptions","organizations_url":"https://api.github.com/users/jangsutsr/orgs","repos_url":"https://api.github.com/users/jangsutsr/repos","events_url":"https://api.github.com/users/jangsutsr/events{/privacy}","received_events_url":"https://api.github.com/users/jangsutsr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-15T14:37:40Z","updated_at":"2016-07-15T16:29:33Z","closed_at":null,"body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\r\n\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n`apt_repository`\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.1.0.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### CONFIGURATION\r\nNo config changes.\r\n\r\n##### OS / ENVIRONMENT\r\nRunning/Managing: Ubuntu 14.04\r\n\r\n##### SUMMARY\r\nSee title.\r\n\r\n##### STEPS TO REPRODUCE\r\nRun the following playbook against localhost:\r\n```\r\n- hosts: all\r\n  vars:\r\n    repo_file: '/etc/apt/sources.list.d/ppa_jal233_proot_trusty.list'\r\n\r\n  tasks:\r\n    - name: 'Remove repo file'\r\n      file:\r\n        path: '{{ repo_file }}'\r\n        state: 'absent'\r\n\r\n    - name: 'Install apt repo with mode:0400'\r\n      apt_repository:\r\n        repo: 'ppa:jal233/proot'\r\n        mode: '0400'\r\n\r\n    - name: 'stat the repo_file'\r\n      stat:\r\n        path: '{{ repo_file }}'\r\n      register: before_stat\r\n\r\n    - name: 'Install apt repo with mode:0644 perms'\r\n      apt_repository:\r\n        repo: 'ppa:jal233/proot'\r\n        mode: '0400'\r\n      register: result\r\n\r\n    - name: 'stat the repo_file'\r\n      stat:\r\n        path: '{{ repo_file }}'\r\n      register: after_stat\r\n\r\n    - assert:\r\n        that:\r\n          - \"'{{ before_stat.stat.mode }}' == '0400'\"\r\n          - \"'{{ after_stat.stat.mode }}' == '0644'\"\r\n          - '{{ result.changed }}'\r\n```\r\n\r\n##### EXPECTED RESULTS\r\n<!--- What did you expect to happen when running the steps above? -->\r\nThe playbook succeeded, meaning that file mode changed.\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\n\r\nPLAY [all] *********************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nok: [localhost]\r\n\r\nTASK [Remove repo file] ********************************************************\r\nok: [localhost]\r\n\r\nTASK [Install apt repo with mode:0400] *****************************************\r\nchanged: [localhost]\r\n\r\nTASK [stat the repo_file] ******************************************************\r\nok: [localhost]\r\n\r\nTASK [Install apt repo with mode:0644 perms] ***********************************\r\nok: [localhost]\r\n\r\nTASK [stat the repo_file] ******************************************************\r\nok: [localhost]\r\n\r\nTASK [assert] ******************************************************************\r\nfatal: [localhost]: FAILED! => {\"assertion\": \"'0400' == '0644'\", \"changed\": false, \"evaluated_to\": false, \"failed\": true}\r\n\r\nNO MORE HOSTS LEFT *************************************************************\r\n\tto retry, use: --limit @troubleshooting.retry\r\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost                  : ok=6    changed=1    unreachable=0    failed=1   \r\n\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/233000663","html_url":"https://github.com/ansible/ansible-modules-core/issues/4194#issuecomment-233000663","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4194","id":233000663,"user":{"login":"abadger","id":209242,"avatar_url":"https://avatars.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"created_at":"2016-07-15T16:29:33Z","updated_at":"2016-07-15T16:29:33Z","body":"Note that if we do change this we may want to be cautious and only change it in devel.  It is a change to documented behaviour after all, so someone may be relying on it.\r\n\r\nAlso -- if we change it, we probably need to change the argument_spec for mode into a tristate.  ie:  default=None.  If newly created, use the value of mode or, if None, use 0644.  If already existing and mode is None, do not change mode.  If already existing and mode is set, then change the mode."}}
{"actor":{"display_login":"abadger"}}