{"action":"opened","issue":{"url":"https://api.github.com/repos/DataDog/ansible-datadog/issues/39","repository_url":"https://api.github.com/repos/DataDog/ansible-datadog","labels_url":"https://api.github.com/repos/DataDog/ansible-datadog/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/DataDog/ansible-datadog/issues/39/comments","events_url":"https://api.github.com/repos/DataDog/ansible-datadog/issues/39/events","html_url":"https://github.com/DataDog/ansible-datadog/issues/39","id":197855232,"number":39,"title":"Permission denied on apt-get when using datadog role","user":{"login":"ollyculverhouse","id":838954,"avatar_url":"https://avatars.githubusercontent.com/u/838954?v=3","gravatar_id":"","url":"https://api.github.com/users/ollyculverhouse","html_url":"https://github.com/ollyculverhouse","followers_url":"https://api.github.com/users/ollyculverhouse/followers","following_url":"https://api.github.com/users/ollyculverhouse/following{/other_user}","gists_url":"https://api.github.com/users/ollyculverhouse/gists{/gist_id}","starred_url":"https://api.github.com/users/ollyculverhouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ollyculverhouse/subscriptions","organizations_url":"https://api.github.com/users/ollyculverhouse/orgs","repos_url":"https://api.github.com/users/ollyculverhouse/repos","events_url":"https://api.github.com/users/ollyculverhouse/events{/privacy}","received_events_url":"https://api.github.com/users/ollyculverhouse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-28T13:42:13Z","updated_at":"2016-12-28T13:42:13Z","closed_at":null,"body":"I am seeing an issue with the datadog role where it is failing due to apt-get not being available. Below is the output from ansible:\r\n\r\n```\r\nTASK [Datadog.datadog : apt] ***************************************************\r\nok: [52.56.74.57]\r\n\r\nTASK [Datadog.datadog : apt_key] ***********************************************\r\nchanged: [52.56.74.57]\r\n\r\nTASK [Datadog.datadog : apt_key] ***********************************************\r\nskipping: [52.56.74.57]\r\n\r\nTASK [Datadog.datadog : apt_key] ***********************************************\r\nchanged: [52.56.74.57]\r\n\r\nTASK [Datadog.datadog : apt_key] ***********************************************\r\nskipping: [52.56.74.57]\r\n\r\nTASK [Datadog.datadog : apt_repository] ****************************************\r\nchanged: [52.56.74.57]\r\n\r\nTASK [Datadog.datadog : apt] ***************************************************\r\nfatal: [52.56.74.57]: FAILED! => {\"cache_update_time\": 1482931915, \"cache_updated\": false, \"changed\": false, \"failed\": true, \"msg\": \"'/usr/bin/apt-get -y -o \\\"Dpkg::Options::=--force-confdef\\\" -o \\\"Dpkg::Options::=--force-confold\\\"     install 'datadog-agent'' failed: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)\\nE: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?\\n\", \"stderr\": \"E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)\\nE: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?\\n\", \"stdout\": \"\", \"stdout_lines\": []}\r\n```\r\n\r\nIt definitely has sudo permission as the same playbook performs other tasks. \r\nCould it be because the previous apt_repository task hasn't completed?\r\n\r\nI have just manually added a pause task (http://docs.ansible.com/ansible/pause_module.html), inbetween apt_repository and apt (for 30 seconds, just to test) and everything goes through correctly and installs. Looks like that was it!\r\n\r\nFor your reference I am running Ubuntu 16.04.1 LTS.\r\n\r\nHope that helps?\r\n"}}
{"actor":{"display_login":"ollyculverhouse"}}