Fix a couple undefined variables
One was a typo and one needed to have the variable defined in that scope
This commit is contained in:
parent
79895061b4
commit
badce91e80
1 changed files with 8 additions and 5 deletions
|
@ -104,11 +104,15 @@ EXAMPLES = '''
|
||||||
- firewalld: masquerade=yes state=enabled permanent=true zone=dmz
|
- firewalld: masquerade=yes state=enabled permanent=true zone=dmz
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
fw = None
|
fw = None
|
||||||
fw_offline = False
|
fw_offline = False
|
||||||
Rich_Rule = None
|
Rich_Rule = None
|
||||||
FirewallClientZoneSettings = None
|
FirewallClientZoneSettings = None
|
||||||
|
|
||||||
|
module = None
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# fw_offline helpers
|
# fw_offline helpers
|
||||||
#
|
#
|
||||||
|
@ -362,6 +366,7 @@ def set_rich_rule_disabled_permanent(zone, rule):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
global module
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
|
@ -443,7 +448,7 @@ def main():
|
||||||
if module.params['interface'] != None and module.params['zone'] == None:
|
if module.params['interface'] != None and module.params['zone'] == None:
|
||||||
module.fail(msg='zone is a required parameter')
|
module.fail(msg='zone is a required parameter')
|
||||||
|
|
||||||
if module.params['immediate'] and fw_offiline:
|
if module.params['immediate'] and fw_offline:
|
||||||
module.fail(msg='firewall is not currently running, unable to perform immediate actions without a running firewall daemon')
|
module.fail(msg='firewall is not currently running, unable to perform immediate actions without a running firewall daemon')
|
||||||
|
|
||||||
## Global Vars
|
## Global Vars
|
||||||
|
@ -721,7 +726,5 @@ def main():
|
||||||
module.exit_json(changed=changed, msg=', '.join(msgs))
|
module.exit_json(changed=changed, msg=', '.join(msgs))
|
||||||
|
|
||||||
|
|
||||||
#################################################
|
if __name__ == '__main__':
|
||||||
# import module snippets
|
|
||||||
from ansible.module_utils.basic import *
|
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in a new issue