File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
tests/operations/docker.network Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ def network(
227227 ipam_driver = "" ,
228228 subnet = "" ,
229229 scope = "" ,
230+ aux_addresses = None ,
230231 opts = None ,
231232 ipam_opts = None ,
232233 labels = None ,
@@ -279,6 +280,7 @@ def network(
279280 ipam_driver = ipam_driver ,
280281 subnet = subnet ,
281282 scope = scope ,
283+ aux_addresses = aux_addresses ,
282284 opts = opts ,
283285 ipam_opts = ipam_opts ,
284286 labels = labels ,
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ def _remove_volume(**kwargs):
117117
118118def _create_network (** kwargs ):
119119 command = []
120+ aux_addresses = kwargs ["aux_addresses" ] if kwargs ["aux_addresses" ] else {}
120121 opts = kwargs ["opts" ] if kwargs ["opts" ] else []
121122 ipam_opts = kwargs ["ipam_opts" ] if kwargs ["ipam_opts" ] else []
122123 labels = kwargs ["labels" ] if kwargs ["labels" ] else []
@@ -146,6 +147,9 @@ def _create_network(**kwargs):
146147 if kwargs ["attachable" ]:
147148 command .append ("--attachable" )
148149
150+ for host , address in aux_addresses .items ():
151+ command .append ("--aux-address '{0}={1}'" .format (host , address ))
152+
149153 for opt in opts :
150154 command .append ("--opt {0}" .format (opt ))
151155
Original file line number Diff line number Diff line change 1+ {
2+ "kwargs" : {
3+ "network" : " nginx" ,
4+ "driver" : " macvlan" ,
5+ "gateway" : " 192.168.1.1" ,
6+ "ip_range" : " 192.168.1.192/27" ,
7+ "subnet" : " 192.168.1.1/24" ,
8+ "aux_addresses" : {
9+ "host" : " 192.168.1.223"
10+ },
11+ "present" : true
12+ },
13+ "facts" : {
14+ "docker.DockerNetwork" : {
15+ "object_id=nginx" : []
16+ }
17+ },
18+ "commands" : [
19+ " docker network create nginx -d macvlan --gateway 192.168.1.1 --ip-range 192.168.1.192/27 --subnet 192.168.1.1/24 --aux-address 'host=192.168.1.223'"
20+ ]
21+ }
You can’t perform that action at this time.
0 commit comments