Hi all,
I just started playing with Ansible. I Needs some help. I build a test setup:
- Using: ansible-galaxy collection install check_point.mgmt, v1.0.6
- Smartcenter R80.40, latest jumbo
Everything is working, I am able to create a network object using a playbook. My working example:
----------- WORKING PLAYBOOK -----------
- name: playbook name
hosts: check_point
connection: httpapi
tasks:
- name: This is the first network
cp_mgmt_network:
name: "TEST"
subnet: 1.1.1.0
mask_length: 24
cp_mgmt_network:
name: "TEST2"
subnet: 2.2.2.0
mask_length: 24
auto_publish_session: true
---------------------------------------------------
Now my challenge, I would like to extend this playbook to add also a host object. My new script:
------------ FAILED PLAYBOOK --------------------
- name: playbook name
hosts: check_point
connection: httpapi
tasks:
- name: "Test with two Check Point networks"
cp_mgmt_network:
name: "TEST"
subnet: 1.1.1.0
mask_length: 24
cp_mgmt_network:
name: "TEST2"
subnet: 2.2.2.0
mask_length: 24
- name: "Add a new host object"
cp_mgmt_host:
name: "Test3"
ip_address: 3.3.3.3
-----------------------------------------------------
Error output:
ERROR! Syntax Error while loading YAML.
did not find expected '-' indicator
The error appears to be in '/etc/ansible/test.yml': line 14, column 6, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
mask_length: 24
- name: "Add a new host object"
^ here
-----------------------------------------------------
Could you please assist? I am really new to ansible.
Thanks!!!
Regards, Paul