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

Ip_netns: fix bug and two enhancements #46572

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
3 participants
@ssahani
Contributor

ssahani commented Oct 6, 2018

SUMMARY
ISSUE TYPE
  • Bugfix Pull Request
    when the module looks whether the namespce exists it tries to execute
    a command in that namespace which results in failing and nothing happens
    afterwards
"msg": "Cannot open network namespace \"test2\": No such file or directory\n"

The correct way to do so it whether the namespace name exists in the
path '/var/run/netns' since ip netns create a file of the namespace name
in '/var/run/netns'.

  • Feature Pull Request
    This work adds support to set NETNSID and execute command in namespace.
      - ip_netns:
                name: test4
                state: present

       - ip_netns:
                name: test4
                netnsid: 14

       - ip_netns:
                name: test4
                command: "ip link set dev eth0 up"
COMPONENT NAME

ip_netns

ANSIBLE VERSION
"ansible 2.8.0.dev0"
ADDITIONAL INFORMATION

@ssahani ssahani changed the title from Ipnetns to Ip_netns: fix bug and two enhancements Oct 6, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Oct 6, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 2 errors:

lib/ansible/modules/net_tools/ip_netns.py:0:0: E322 "command" is listed in the argument_spec, but not documented in the module
lib/ansible/modules/net_tools/ip_netns.py:0:0: E322 "netnsid" is listed in the argument_spec, but not documented in the module

click here for bot help

net_tools: ip_netns - Add support to set NETNSID and execute cmd in n…
…amespace

This work adds support to set NETNSID and execute command in namespace.

```
      - ip_netns:
                name: test4
                state: present

       - ip_netns:
                name: test4
                netnsid: 14

       - ip_netns:
                name: test4
                command: "ip link set dev eth0 up"
```

Signed-off-by: Susant Sahani <susant@redhat.com>

@ssahani ssahani force-pushed the ssahani:ipnetns branch from 13f7657 to f3bcfba Oct 30, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Oct 30, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 2 errors:

lib/ansible/modules/net_tools/ip_netns.py:0:0: E322 "command" is listed in the argument_spec, but not documented in the module
lib/ansible/modules/net_tools/ip_netns.py:0:0: E322 "netnsid" is listed in the argument_spec, but not documented in the module

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Dec 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment