Ohh i got it. i installed the module and it worked but when i am running a below playbook -
---
- hosts: GW
tasks:
- name: "login"
check_point_mgmt:
command: login
parameters:
username: "{{mgmt_user}}"
password: "{{mgmt_password}}"
management: "{{mgmt_server}}"
fingerprint: "{{fingerprint}}"
register: login_response
- name: "add test host"
check_point_mgmt:
command: add-host
parameters:
name: "test-123abc"
ip-address: "1.1.1.2"
color: "red"
session-data: "{{login_response}}"
- name: "discard"
check_point_mgmt:
command: discard
session-data: "{{login_response}}"
- name: "logout"
check_point_mgmt:
command: logout
session-data: "{{login_response}}"
i can't see host is created.
i get below output:
ankur@ankur-virtual-machine:~/71442b35e6e8d830e19f776a7b1b6cc8$ ansible-playbook ansible-cp-test.yml
PLAY [GW] ******************************************************************************************************************************************************************
TASK [Gathering Facts] *****************************************************************************************************************************************************
ok: [127.0.0.1]
TASK [login] ***************************************************************************************************************************************************************
[WARNING]: The value {'username': 'admin', 'management': '192.168.155.20', 'password': 'vpn123'} (type dict) in a string field was converted to u"{'username': 'admin',
'management': '192.168.155.20', 'password': 'vpn123'}" (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.
ok: [127.0.0.1]
TASK [add test host] *******************************************************************************************************************************************************
[WARNING]: The value {'failed': False, 'changed': False, 'response': {'domain': None, 'url': '192.168.155.20:443', 'sid': '2jP5iL__pFExFqxlgO0nz9zdtdX0MStlhWyLrlFsiTI',
'context': 'web_api', 'fingerprint': '707C3540158E780AA86476233C1D46E56BEDE2EA', 'api_version': '1.1'}, 'warnings': ['The value {\'username\': \'admin\', \'management\':
\'192.168.155.20\', \'password\': \'vpn123\'} (type dict) in a string field was converted to u"{\'username\': \'admin\', \'management\': \'192.168.155.20\', \'password\':
\'vpn123\'}" (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.']} (type dict) in a string field was converted
to u'{\'failed\': False, \'changed\': False, \'response\': {\'domain\': None, \'url\': \'192.168.155.20:443\', \'sid\': \'2jP5iL__pFExFqxlgO0nz9zdtdX0MStlhWyLrlFsiTI\',
\'context\': \'web_api\', \'fingerprint\': \'707C3540158E780AA86476233C1D46E56BEDE2EA\', \'api_version\': \'1.1\'}, \'warnings\': [\'The value {\\\'username\\\':
\\\'admin\\\', \\\'management\\\': \\\'192.168.155.20\\\', \\\'password\\\': \\\'vpn123\\\'} (type dict) in a string field was converted to u"{\\\'username\\\':
\\\'admin\\\', \\\'management\\\': \\\'192.168.155.20\\\', \\\'password\\\': \\\'vpn123\\\'}" (type string). If this does not look like what you expect, quote the entire
value to ensure it does not change.\']}' (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.
[WARNING]: The value {'color': 'red', 'name': 'test-123abc', 'ip-address': '1.1.1.2'} (type dict) in a string field was converted to u"{'color': 'red', 'name': 'test-
123abc', 'ip-address': '1.1.1.2'}" (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.
changed: [127.0.0.1]
TASK [discard] *************************************************************************************************************************************************************
ok: [127.0.0.1]
TASK [logout] **************************************************************************************************************************************************************
ok: [127.0.0.1]
PLAY RECAP *****************************************************************************************************************************************************************
127.0.0.1 : ok=5 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Further why are we using 127.0.0.1?
Thanks