Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker_container always reports changed when using network_mode: container:<name> #49794

Closed
bengerman13 opened this issue Dec 11, 2018 · 9 comments · Fixed by #49797
Closed
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. cloud docker module This issue/PR relates to a module. python3 support:community This issue/PR relates to code supported by the Ansible community.

Comments

@bengerman13
Copy link
Contributor

SUMMARY

when using docker_container, if you set network_mode with a container:name, it always reports changed

ISSUE TYPE
  • Bug Report
COMPONENT NAME

docker_container

ANSIBLE VERSION
ansible 2.7.1
  config file = None
  configured module search path = ['/home/benb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/benb/.local/share/virtualenvs/ansible-platform-pnaOgkJy/lib/python3.7/site-packages/ansible
  executable location = /home/benb/.local/share/virtualenvs/ansible-platform-pnaOgkJy/bin/ansible
  python version = 3.7.0 (default, Sep 12 2018, 18:30:08) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]


CONFIGURATION
$ ansible-config dump --only-changed
$ 
OS / ENVIRONMENT

Host and guest are Ubuntu 18.04

STEPS TO REPRODUCE
- name: Start telegraf sidecar container
  docker_container:
    name: telegraf_1
    image: telegraf
    network_mode: container:other_container

- name: Do it again
  docker_container:
    name: telegraf_1
    image: telegraf
    network_mode: container:other_container

EXPECTED RESULTS

Do it again should not report changed

ACTUAL RESULTS
        "changed": true,
        "diff": {
            "differences": [
                {
                    "network_mode": {
                        "container": "container:ef16e4f7a9f868fa0b0c409eb46b13a685174ce6c1f87878e8955283aab1516d",
                        "parameter": "container:other_container"
                    }
                }
            ]
        }
@ansibot
Copy link
Contributor

ansibot commented Dec 11, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. cloud docker module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. python3 support:community This issue/PR relates to code supported by the Ansible community. labels Dec 11, 2018
@felixfontein
Copy link
Contributor

This has been fixed in #47997; it is contained both in Ansible 2.7.2 and 2.6.x (don't ask me from which X on, though :) ).

@DBendit
Copy link
Contributor

DBendit commented Dec 11, 2018

No, this is definitely still happening. I just wrote up some integ tests to verify it and I'm seeing the reported functionality in 2.8. While pid_mode and ipc_mode have their container names replaced, network_mode doesn't.

@ansibot ansibot closed this as completed Dec 11, 2018
@bengerman13
Copy link
Contributor Author

@felixfontein this is still happening for me with 2.7.2

ansible 2.7.2
  config file = None
  configured module search path = ['/home/benb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/benb/.local/share/virtualenvs/ansible-platform-pnaOgkJy/lib/python3.7/site-packages/ansible
  executable location = /home/benb/.local/share/virtualenvs/ansible-platform-pnaOgkJy/bin/ansible
  python version = 3.7.0 (default, Sep 12 2018, 18:30:08) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]

@felixfontein
Copy link
Contributor

Ah, I guess I misread that, then. Sorry!

@resmo
Copy link
Contributor

resmo commented Dec 11, 2018

reopening on requests.

@resmo resmo reopened this Dec 11, 2018
@ansibot ansibot closed this as completed Dec 11, 2018
@DBendit
Copy link
Contributor

DBendit commented Dec 11, 2018

Guess the bot really wants this closed.

Regardless, I've already got a fix in PR. I'll backport it to 2.7 once it's merged in, though it won't be released until 2.7.6, since 2.7.5 is already locked down.

@jborean93 jborean93 reopened this Dec 11, 2018
@ansible ansible deleted a comment from felixfontein Dec 11, 2018
@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Dec 11, 2018
@bengerman13
Copy link
Contributor Author

Thank you, @DBendit

@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. cloud docker module This issue/PR relates to a module. python3 support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants