Skip to content

Commit

Permalink
Add ipv6 to network and fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sshnaidm committed Dec 20, 2020
1 parent 2a84642 commit 2d88598
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugins/modules/podman_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
description:
- Allocate container IP from range
type: str
ipv6:
description:
- Enable IPv6 (Dual Stack) networking. You must pass a IPv6 subnet.
The subnet option must be used with the ipv6 option.
type: bool
subnet:
description:
- Subnet in CIDR format
Expand Down Expand Up @@ -140,7 +145,6 @@
]
"""

# noqa: F402
import json # noqa: F402
from distutils.version import LooseVersion # noqa: F402
import os # noqa: F402
Expand Down Expand Up @@ -218,6 +222,9 @@ def addparam_subnet(self, c):
def addparam_ip_range(self, c):
return c + ['--ip-range', self.params['ip_range']]

def addparam_ipv6(self, c):
return c + ['--ipv6']

def addparam_macvlan(self, c):
return c + ['--macvlan', self.params['macvlan']]

Expand Down Expand Up @@ -548,14 +555,16 @@ def main():
gateway=dict(type='str', required=False),
internal=dict(type='bool', required=False),
ip_range=dict(type='str', required=False),
ipv6=dict(type='bool', required=False),
subnet=dict(type='str', required=False),
macvlan=dict(type='str', required=False),
executable=dict(type='str', required=False, default='podman'),
debug=dict(type='bool', default=False),
recreate=dict(type='bool', default=False),
),
required_by=dict( # for IP range to set 'subnet' is required
required_by=dict( # for IP range and GW to set 'subnet' is required
ip_range=('subnet'),
gateway=('subnet'),
))

PodmanNetworkManager(module).execute()
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/targets/podman_network/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
name: "{{ network_name }}"
state: present
gateway: 10.100.100.100
subnet: 10.100.100.0/24
register: info6

- name: Check info
Expand All @@ -126,6 +127,7 @@
name: "{{ network_name }}"
state: present
gateway: 10.100.100.100
subnet: 10.100.100.0/24
register: info7

- name: Check info
Expand Down

0 comments on commit 2d88598

Please sign in to comment.