{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/49199","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/49199/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/49199/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/49199/events","html_url":"https://github.com/ansible/ansible/issues/49199","id":384895000,"node_id":"MDU6SXNzdWUzODQ4OTUwMDA=","number":49199,"title":"docker_swarm_service fails because of default \"user: root\"","user":{"login":"fchiacchiaretta","id":23556082,"node_id":"MDQ6VXNlcjIzNTU2MDgy","avatar_url":"https://avatars3.githubusercontent.com/u/23556082?v=4","gravatar_id":"","url":"https://api.github.com/users/fchiacchiaretta","html_url":"https://github.com/fchiacchiaretta","followers_url":"https://api.github.com/users/fchiacchiaretta/followers","following_url":"https://api.github.com/users/fchiacchiaretta/following{/other_user}","gists_url":"https://api.github.com/users/fchiacchiaretta/gists{/gist_id}","starred_url":"https://api.github.com/users/fchiacchiaretta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchiacchiaretta/subscriptions","organizations_url":"https://api.github.com/users/fchiacchiaretta/orgs","repos_url":"https://api.github.com/users/fchiacchiaretta/repos","events_url":"https://api.github.com/users/fchiacchiaretta/events{/privacy}","received_events_url":"https://api.github.com/users/fchiacchiaretta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-27T17:02:19Z","updated_at":"2018-11-27T17:02:19Z","closed_at":null,"author_association":"NONE","body":"##### SUMMARY\r\nI'm trying to start a service ([Traefik Load Balancer](https://traefik.io)) via docker_swarm_service and it fails because of `user: root` being passed by default in the invocation.\r\nI can properly start the service if I specify `user: ''` or `user: ` (passes as user: null in the invocation), but service declaration is not idempotent, every time I run the deploy I get \r\n```json\r\n[...]\r\n    \"changed\": true,\r\n    \"changes\": [\r\n        \"user\"\r\n    ],\r\n[...]\r\n```\r\n\r\n##### ISSUE TYPE\r\n- Bug Report\r\n\r\n##### COMPONENT NAME\r\ndocker_swarm_service\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.7.2\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = ['/home/fchiacchiaretta/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /usr/lib/python3.7/site-packages/ansible\r\n  executable location = /usr/bin/ansible\r\n  python version = 3.7.1 (default, Nov 23 2018, 10:01:49) [GCC 8.2.1 20181105 (Red Hat 8.2.1-5)]\r\n```\r\n\r\n##### CONFIGURATION\r\n\r\n\r\n##### OS / ENVIRONMENT\r\n<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->\r\nControl station OS: Fedora 29\r\nTarget OS: Debian 8.11 Jessie\r\nTarget docker version:\r\n\r\n```\r\nServer:\r\n Engine:\r\n  Version:          18.06.1-ce\r\n  API version:      1.38 (minimum version 1.12)\r\n  Go version:       go1.10.3\r\n  Git commit:       e68fc7a\r\n  Built:            Tue Aug 21 17:23:29 2018\r\n  OS/Arch:          linux/amd64\r\n  Experimental:     false\r\n```\r\n\r\n##### STEPS TO REPRODUCE\r\nStart a traefik service:\r\n```yaml\r\n  - name: Create traefik LB on manager node\r\n    docker_swarm_service:\r\n      debug: yes\r\n      name: traefik-lb\r\n      image: 'traefik:1.7'\r\n      user:\r\n      constraints:\r\n      - \"node.role==manager\"\r\n      networks:\r\n      - traefik-net\r\n      publish:\r\n      - published_port: 8080\r\n        target_port: 8080\r\n      - published_port: 8081\r\n        target_port: 8081\r\n      args:\r\n      - \"--defaultEntryPoints=http\"\r\n      - \"--entryPoints=Name:http Address::8080\"\r\n      - \"--entryPoints=Name:mgt Address::8081\"\r\n      - \"--docker\"\r\n      - \"--docker.swarmMode\"\r\n      - \"--docker.domain=traefik\"\r\n      - \"--docker.watch\"\r\n      - \"--api\"\r\n      - \"--api.entrypoint=mgt\"\r\n      - \"--api.statistics.recentErrors=100\"\r\n      mounts:\r\n      - source: \"/var/run/docker.sock\"\r\n        target: \"/var/run/docker.sock\"\r\n        type: bind\r\n```\r\n\r\n##### EXPECTED RESULTS\r\nI can start a service without specifying user parameter\r\n\r\n##### ACTUAL RESULTS\r\nService start fails. If I specify `user: ''` or `user: ` (passes as user: null in the invocation) it succeeds, but it is not idempotent anymore.\r\n\r\n\r\nBest,\r\nFederico Chiacchiaretta"}}
{"actor":{"display_login":"fchiacchiaretta"}}