---
- name: modifyRoutes
gather_facts: no
connection: local
hosts: PaloAlto
vars:
action: StaticRouteAddition
vdom: root
interfacename: ['interface port-channel 35.3102']
interfacename2: port-channel 35.3102
ip: 192.168.101.101
mask: 255.255.255.0
speedmode: auto
duplexmode: auto
securityinterfacename: inside
securitylevelnumber: 0
devicetype: PALOALTO
routeModificationType: addition
routeMode:
hostIPAddress: 192.168.101.101
hostIPMask: 255.255.255.0
nextHopIP: 192.168.102.102
adminDistance: 10
destIPAddress:
destIPMask:
destGatewayIPAddress:
distanceValue:
comments:
portNum:
cli:
host:
username:
password:
auth_pass:
authorize: yes
timeout: 100
tasks:
- name: StaticRouteAddition
when: action == "StaticRouteAddition" and devicetype == "PALOALTO"
panos_op:
commands:
- "set networkk virtual-router {{vrName}} routing-table ip static-route {{routerName}} nexthop ip-address {{nxtHOPAddress}}"
provider: "{{ cli }}"
- name: StaticRouteDeletion
when: action == "StaticRouteAddition" and devicetype == "PALOALTO"
panos_op:
commands:
- "unset networkk virtual-router {{vrName}} routing-table ip static-route {{routerName}} nexthop ip-address {{nxtHOPAddress}}"
provider: "{{ cli }}"