{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/49547","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/49547/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/49547/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/49547/events","html_url":"https://github.com/ansible/ansible/issues/49547","id":387797543,"node_id":"MDU6SXNzdWUzODc3OTc1NDM=","number":49547,"title":"docker_swarm: labels not applied","user":{"login":"ivanmrva","id":13832119,"node_id":"MDQ6VXNlcjEzODMyMTE5","avatar_url":"https://avatars2.githubusercontent.com/u/13832119?v=4","gravatar_id":"","url":"https://api.github.com/users/ivanmrva","html_url":"https://github.com/ivanmrva","followers_url":"https://api.github.com/users/ivanmrva/followers","following_url":"https://api.github.com/users/ivanmrva/following{/other_user}","gists_url":"https://api.github.com/users/ivanmrva/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanmrva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanmrva/subscriptions","organizations_url":"https://api.github.com/users/ivanmrva/orgs","repos_url":"https://api.github.com/users/ivanmrva/repos","events_url":"https://api.github.com/users/ivanmrva/events{/privacy}","received_events_url":"https://api.github.com/users/ivanmrva/received_events","type":"User","site_admin":false},"labels":[{"id":947190508,"node_id":"MDU6TGFiZWw5NDcxOTA1MDg=","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.7","name":"affects_2.7","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":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":383076471,"node_id":"MDU6TGFiZWwzODMwNzY0NzE=","url":"https://api.github.com/repos/ansible/ansible/labels/python3","name":"python3","color":"fbca04","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":6,"created_at":"2018-12-05T15:02:47Z","updated_at":"2018-12-11T12:44:58Z","closed_at":null,"author_association":"NONE","body":"##### SUMMARY\r\n\"labels\" parameter of \"docker_swarm\" module is ignored (resp. labels are not applied on the target node)\r\n\r\n##### ISSUE TYPE\r\n- Bug Report\r\n\r\n##### COMPONENT NAME\r\ndocker_swarm\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes -->\r\n```paste below\r\nansible 2.7.1\r\n  config file = /media/data/projects/alv/workspace/central-deployment/ansible.cfg\r\n  configured module search path = ['/home/ivmr/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /usr/lib64/python3.6/site-packages/ansible\r\n  executable location = /usr/lib/python-exec/python3.6/ansible\r\n  python version = 3.6.5 (default, Jul  7 2018, 14:08:42) [GCC 7.3.0]\r\n```\r\n\r\n##### CONFIGURATION\r\n<!--- Paste verbatim output from \"ansible-config dump --only-changed\" between quotes -->\r\n```paste below\r\n\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\ngentoo linux, kernel 4.14.52\r\n\r\n##### STEPS TO REPRODUCE\r\n<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->\r\nJust use docker_swarm module with \"state:join\" and  \"labels\" parameter. \r\nSee the full role below (incl. swarm initialization). The rest (besides labels) works just fine.\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n- name: Init a docker swarm\r\n  docker_swarm:\r\n    advertise_addr: \"{{ hostvars['docker-swarm-manager']['ansible_default_ipv4']['address'] }}\"\r\n    state: present\r\n  when: inventory_hostname == 'docker-swarm-manager'\r\n\r\n- name: Get swarm info\r\n  docker_swarm:\r\n    state: inspect\r\n  register: swarm_info\r\n  when: inventory_hostname == 'docker-swarm-manager'\r\n\r\n- name: Add data workers to docker swarm\r\n  docker_swarm:\r\n    state: join\r\n    join_token: \"{{ hostvars['docker-swarm-manager']['swarm_info']['swarm_facts']['JoinTokens']['Worker'] }}\"\r\n    advertise_addr: \"{{ ansible_default_ipv4.address }}\"\r\n    remote_addrs: [\"{{ hostvars['docker-swarm-manager']['ansible_default_ipv4']['address'] }}\"]\r\n    labels:\r\n      type: data\r\n  when: inventory_hostname in groups['docker-swarm-data-workers']\r\n```\r\n\r\n<!--- HINT: You can paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- Describe what you expected to happen when running the steps above -->\r\nLabels are applied on the target docker swarm node.\r\n\r\n##### ACTUAL RESULTS\r\n<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->\r\nThe ansible script doesn't produce any error. \r\nOn the other side, no changes are also recognized if I add/remove \"labels\" parameter on the node that is already attached to an existing docker swarm cluster.\r\n\r\nVerification of labels on the target host:\r\n`docker node inspect <host>`\r\njust returns no labels: ` \"Labels\": {},`\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/446189835","html_url":"https://github.com/ansible/ansible/issues/49547#issuecomment-446189835","issue_url":"https://api.github.com/repos/ansible/ansible/issues/49547","id":446189835,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjE4OTgzNQ==","user":{"login":"ansibot","id":6585283,"node_id":"MDQ6VXNlcjY1ODUyODM=","avatar_url":"https://avatars0.githubusercontent.com/u/6585283?v=4","gravatar_id":"","url":"https://api.github.com/users/ansibot","html_url":"https://github.com/ansibot","followers_url":"https://api.github.com/users/ansibot/followers","following_url":"https://api.github.com/users/ansibot/following{/other_user}","gists_url":"https://api.github.com/users/ansibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibot/subscriptions","organizations_url":"https://api.github.com/users/ansibot/orgs","repos_url":"https://api.github.com/users/ansibot/repos","events_url":"https://api.github.com/users/ansibot/events{/privacy}","received_events_url":"https://api.github.com/users/ansibot/received_events","type":"User","site_admin":false},"created_at":"2018-12-11T12:44:58Z","updated_at":"2018-12-11T12:44:58Z","author_association":"CONTRIBUTOR","body":"cc @DBendit\n[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)\n<!--- boilerplate: notify --->"}}
{"actor":{"display_login":"ansibot"}}