Hello,
I have this task:
- os_security_group_rule:
cloud: "{{ cloud }}"
security_group: "{{ item.name }}"
protocol: "{{ item.protocol }}"
port_range_min: "{{ item.port_range_min }}"
port_range_max: "{{ item.port_range_max }}"
remote_ip_prefix: "{{ item.remote_ip_prefix }}"
with_items: "{{ security_groups }}"
The parameters port_range_min and port_range_max are optional
If I set these variables as null, item displays as null but for invocation displays as empty string.
How can I put these variables as null for invocation ?
failed: [localhost] (item={'protocol': 'icmp', 'port_range_min': None, 'port_range_max': None, 'name': 'icmp', 'remote_ip_prefix': '0.0.0.0/0'}) => {
"changed": false,
"invocation": {
"module_args": {
"cloud": "toto",
"direction": "ingress",
"ethertype": "IPv4",
"interface": "public",
"port_range_max": "",
"port_range_min": "",
"protocol": "icmp",
"remote_ip_prefix": "0.0.0.0/0",
"security_group": "icmp",
"state": "present",
"timeout": 180,
"wait": true
}
},
"item": {
"name": "icmp",
"port_range_max": null,
"port_range_min": null,
"protocol": "icmp",
"remote_ip_prefix": "0.0.0.0/0"
},
"msg": "argument port_range_min is of type <class 'str'> and we were unable to convert to int: invalid literal for int() with base 10: ''"
}