{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/40284","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/40284/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/40284/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/40284/events","html_url":"https://github.com/ansible/ansible/pull/40284","id":323781915,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg4NTU2Mzgy","number":40284,"title":"Add checks to compare some commonly None values in docker_container","user":{"login":"bengerman13","id":15840717,"node_id":"MDQ6VXNlcjE1ODQwNzE3","avatar_url":"https://avatars2.githubusercontent.com/u/15840717?v=4","gravatar_id":"","url":"https://api.github.com/users/bengerman13","html_url":"https://github.com/bengerman13","followers_url":"https://api.github.com/users/bengerman13/followers","following_url":"https://api.github.com/users/bengerman13/following{/other_user}","gists_url":"https://api.github.com/users/bengerman13/gists{/gist_id}","starred_url":"https://api.github.com/users/bengerman13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengerman13/subscriptions","organizations_url":"https://api.github.com/users/bengerman13/orgs","repos_url":"https://api.github.com/users/bengerman13/repos","events_url":"https://api.github.com/users/bengerman13/events{/privacy}","received_events_url":"https://api.github.com/users/bengerman13/received_events","type":"User","site_admin":false},"labels":[{"id":835286067,"node_id":"MDU6TGFiZWw4MzUyODYwNjc=","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.6","name":"affects_2.6","color":"ededed","default":false},{"id":785271699,"node_id":"MDU6TGFiZWw3ODUyNzE2OTk=","url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":61528803,"node_id":"MDU6TGFiZWw2MTUyODgwMw==","url":"https://api.github.com/repos/ansible/ansible/labels/cloud","name":"cloud","color":"c7def8","default":false},{"id":501518759,"node_id":"MDU6TGFiZWw1MDE1MTg3NTk=","url":"https://api.github.com/repos/ansible/ansible/labels/community_review","name":"community_review","color":"f9d0c4","default":false},{"id":500715204,"node_id":"MDU6TGFiZWw1MDA3MTUyMDQ=","url":"https://api.github.com/repos/ansible/ansible/labels/docker","name":"docker","color":"c5def5","default":false},{"id":496359346,"node_id":"MDU6TGFiZWw0OTYzNTkzNDY=","url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":581543918,"node_id":"MDU6TGFiZWw1ODE1NDM5MTg=","url":"https://api.github.com/repos/ansible/ansible/labels/stale_ci","name":"stale_ci","color":"fef2c0","default":false},{"id":636327968,"node_id":"MDU6TGFiZWw2MzYzMjc5Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-05-16T20:51:09Z","updated_at":"2018-06-15T06:03:09Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/40284","html_url":"https://github.com/ansible/ansible/pull/40284","diff_url":"https://github.com/ansible/ansible/pull/40284.diff","patch_url":"https://github.com/ansible/ansible/pull/40284.patch"},"body":"##### SUMMARY\r\nThe current docker_container comparison logic does not bother checking any unset values, but these can be potentially interesting. For instance, if you specify no volumes, and the container currently has volumes bound, that is a valid difference that should be updated. \r\n\r\nThis PR adds logic to check some parameters of this type. It does this selectively, and the list it checks is probably incomplete.\r\nFixes #35070\r\n\r\n##### ISSUE TYPE\r\n - Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\ndocker_container\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\nben@munin:~/test$ ansible --version\r\nansible 2.6.0 (better-docker-container-compare f237911503) last updated 2018/05/16 13:44:57 (GMT -700)\r\n  config file = /home/ben/test/ansible.cfg\r\n  configured module search path = [u'/home/ben/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /home/ben/dev/github/ansible/ansible/lib/ansible\r\n  executable location = /home/ben/venvs/ansible-devel/bin/ansible\r\n  python version = 2.7.14 (default, Sep 23 2017, 22:06:14) [GCC 7.2.0]\r\n\r\n```\r\n\r\n\r\n##### ADDITIONAL INFORMATION\r\ntesting playbook:\r\n```\r\n- name: \"test docker container recreate\"\r\n  hosts:  localhost\r\n  tasks:\r\n    - name: start the test container\r\n      docker_container:\r\n        name: tester\r\n        image: redis\r\n    - name: this should not restart the container\r\n      docker_container:\r\n        name: tester\r\n        image: redis\r\n    - name: this should restart the test container\r\n      docker_container:\r\n        name: tester\r\n        image: redis\r\n        dns_servers: \"8.8.8.8\"\r\n    - name: this should not restart the test container\r\n      docker_container:\r\n        name: tester\r\n        image: redis\r\n        dns_servers: \"8.8.8.8\"\r\n    - name: this should also restart the test container\r\n      docker_container:\r\n        name: tester\r\n        image: redis\r\n    - name: this should not restart the test container\r\n      docker_container:\r\n        name: tester\r\n        image: redis\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/397522354","html_url":"https://github.com/ansible/ansible/pull/40284#issuecomment-397522354","issue_url":"https://api.github.com/repos/ansible/ansible/issues/40284","id":397522354,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzUyMjM1NA==","user":{"login":"kassiansun","id":10249787,"node_id":"MDQ6VXNlcjEwMjQ5Nzg3","avatar_url":"https://avatars2.githubusercontent.com/u/10249787?v=4","gravatar_id":"","url":"https://api.github.com/users/kassiansun","html_url":"https://github.com/kassiansun","followers_url":"https://api.github.com/users/kassiansun/followers","following_url":"https://api.github.com/users/kassiansun/following{/other_user}","gists_url":"https://api.github.com/users/kassiansun/gists{/gist_id}","starred_url":"https://api.github.com/users/kassiansun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kassiansun/subscriptions","organizations_url":"https://api.github.com/users/kassiansun/orgs","repos_url":"https://api.github.com/users/kassiansun/repos","events_url":"https://api.github.com/users/kassiansun/events{/privacy}","received_events_url":"https://api.github.com/users/kassiansun/received_events","type":"User","site_admin":false},"created_at":"2018-06-15T06:03:09Z","updated_at":"2018-06-15T06:03:09Z","author_association":"CONTRIBUTOR","body":"@bengerman13 Right, add another flag like `strict` or `purge` may be a suitable solution."}}
{"actor":{"display_login":"kassiansun"}}