community / community.windows / 2.2.0 / module / win_route Add or remove a static route Authors: Daniele Lazzari (@dlazz)community.windows.win_route (2.2.0) — module
Install with ansible-galaxy collection install community.windows:==2.2.0
collections: - name: community.windows version: 2.2.0
Add or remove a static route.
--- - name: Add a network static route community.windows.win_route: destination: 192.168.2.10/32 gateway: 192.168.1.1 metric: 1 state: present
- name: Remove a network static route community.windows.win_route: destination: 192.168.2.10/32 state: absent
state: choices: - absent - present default: present description: - If C(absent), it removes a network static route. - If C(present), it adds a network static route. type: str metric: default: 1 description: - Metric used by the static route. type: int gateway: description: - The gateway used by the static route. - If C(gateway) is not provided it will be set to C(0.0.0.0). type: str destination: description: - Destination IP address in CIDR format (ip address/prefix length). required: true type: str
output: description: A message describing the task result. returned: always sample: Route added type: str