deploy_task
FW deployment task
FMGDeployTask #
Bases: CommonTask
Fortimanager Deployment Task
Steps of this task:
1. check firewall statuses
2. deploy changes to firewalls in protected group only
3. check firewall statuses again
Attributes:
Name | Type | Description |
---|---|---|
settings |
FMGSyncSettings
|
task settings to use |
fmg |
FMGSync
|
FMG instance |
_deploy_changes #
Deploy changes to firewalls
Source code in fortimanager_template_sync/deploy_task.py
_get_deployable_firewalls
staticmethod
#
Get list of firewall names which are to be deployed.
Example input - statuses
{
'FW01': {
'cli_status': {
'root': {
'name': 'test_global', 'status': 'modified', 'type': 'cli'
},
'VDOM2': {
'name': 'test_global', 'status': 'modified', 'type': 'cli'
}
},
'conf_status': 'insync', 'db_status': 'nomod', 'dev_status': 'installed'
},
'FW01': {
'cli_status': {
'root': {
'name': 'test_global', 'status': 'modified', 'type': 'cli'
},
},
'conf_status': 'insync', 'db_status': 'nomod', 'dev_status': 'installed'
}
}
Returns:
Type | Description |
---|---|
Dict[str, List[str]]
|
List of Dicts with firewall name as key and VDOM as value |
Raises:
Type | Description |
---|---|
FMGSyncInvalidStatusException
|
In case there is a firewall with conf or db modified, error out. |
Source code in fortimanager_template_sync/deploy_task.py
run #
Run deployment task
Returns:
Type | Description |
---|---|
bool
|
True if task succeeded, False otherwise |