cancel
Showing results for 
Search instead for 
Did you mean: 
Create a Post
Highlighted
mbouri
Ivory

how I can gather in which rule is defined a group object with ansible cp_mgmt_group_facts

Hello,

I'm using ansible to automate a lot of manual task, it works well for the moment but I'm not able to retrieve the information of rule name when I use cp_mgmt_group_facts (like whereused with smartdashboard), below the output of the json :

ok: [localhost] => {
"host_facts": {
"ansible_facts": {
"host": {
"color": "black",
"comments": "",
"domain": {
"domain-type": "domain",
"name": "SMC User",
"uid": "41e821a0-3720-11e3-aa6e-0800200c9fde"
},
"groups": [
{
"domain": {
"domain-type": "domain",
"name": "SMC User",
"uid": "41e821a0-3720-11e3-aa6e-0800200c9fde"
},
"name": "Demo",
"type": "group",
"uid": "8ab21516-39e7-4507-9312-636631d6c5de"
}
],
"icon": "Objects/host",
"interfaces": [],
"ipv4-address": "104.45.16.183",
"meta-info": {
"creation-time": {
"iso-8601": "2019-12-15T07:07+0100",
"posix": 1576390077465
},
"creator": "admin",
"last-modifier": "admin",
"last-modify-time": {
"iso-8601": "2019-12-15T07:07+0100",
"posix": 1576390077465
},
"lock": "unlocked",
"validation-state": "ok"
},
"name": "h-az-104.45.16.183",
"nat-settings": {
"auto-rule": false
},
"read-only": false,
"tags": [],
"type": "host",
"uid": "15e386c6-4ef3-4155-903d-579707171494"
}
},
"changed": false,
"failed": false
}
}

 

I test also with details_level : full  

is there any simple way to retrieve this information without retrieving all the rule base and check on source and destination of each rule 😞

Regards

0 Kudos
4 Replies
Admin
Admin

Re: how I can gather in which rule is defined a group object with ansible cp_mgmt_group_facts

I believe the rule name will be easier to parse out making the call with the option use-object-dictionary false.
To show the contents of each rule you may still need to query it directly.
0 Kudos
mbouri
Ivory

Re: how I can gather in which rule is defined a group object with ansible cp_mgmt_group_facts

Thank you for your reply, but we have migration project to change the some goup used on policy and duplicate the rule in order to use the new object and disable the old rule, and for that we need to know in which rule these group are used. the only solution I have for the moment is to parse all the policy rule (thousand of rule) and check for each rule if the group is configured on source and destination, I would like to know if this feature (specify on with rule the object is configured with the gather_fact module ) will be included on the new ansible release ?   

Regards

0 Kudos
Admin
Admin

Re: how I can gather in which rule is defined a group object with ansible cp_mgmt_group_facts

What is the precise playbook you’re using?
0 Kudos
mbouri
Ivory

Re: how I can gather in which rule is defined a group object with ansible cp_mgmt_group_facts

Hello,

I found solution with the command : where-used fo the module check_point_mgmt

Regards

 

0 Kudos