Hi all, I'm trying to make a playbook to automate some commands on a Check Point (virtual).
Playbook:
---
- hosts: mgmt-server
tasks:
- name: "login"
check_point_mgmt:
command: login
parameters:
username: "{{mgmt_user}}"
password: "{{mgmt_password}}"
management: "{{mgmt_server}}"
fingerprint: "{{mgmt_fingerprint}}"
register: login_response
- name: "set static-route default nexthop gateway address"
command: clish -c 'set static-route default nexthop gateway address 10.0.0.1 on' -s
Host:
## db-[99:101]-node.example.com
[mgmt-server]
127.0.0.1
[mgmt-server:vars]
ansible_user=ubuntu
mgmt_server=10.11.3.185
appliance_name=MGMT
ansible_python_interpreter=/usr/bin/python2.7
mgmt_user=admin
mgmt_password=1q2w3e
mgmt_fingerprint=43:2E:E0:61:FC:0B:E5:BD:02:42:9E:49:FA:79:46:5F:B4:C0:84:2C
Ansible.cfg:
library = /usr/share/my_modules/
Error:
*
fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "clish -c 'set static-route default nexthop gateway address 10.0.0.1 on' -s", "msg": "[Errno 2] No such file or directory", "rc": 2}
But I have NOT problem with playbook:
---
- hosts: mgmt-server
tasks:
- name: "login"
check_point_mgmt:
command: login
parameters:
username: "{{mgmt_user}}"
password: "{{mgmt_password}}"
management: "{{mgmt_server}}"
fingerprint: "{{mgmt_fingerprint}}"
register: login_response
- name: "add host"
check_point_mgmt:
command: add-host
parameters:
name: "host_demo"
ip-address: "1.2.3.5"
session-data: "{{ login_response }}"
- name: "add group"
check_point_mgmt:
command: add-group
parameters:
name: "group_demo"
members:
- "host_demo"
session-data: "{{ login_response }}"
- name: "publish"
check_point_mgmt:
command: publish
session-data: "{{login_response}}"
Can someone assist? Thanks!