1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-23 12:19:15 +00:00

Reformat everything.

This commit is contained in:
Felix Fontein 2025-11-01 12:08:41 +01:00
parent 3f2213791a
commit 340ff8586d
1008 changed files with 61301 additions and 58309 deletions

View file

@ -130,26 +130,26 @@ def disable_policy(module, names, act):
def main():
module = AnsibleModule(
argument_spec=dict(
state=dict(type='str', default='enabled', choices=['disabled', 'enabled']),
name=dict(type='list', elements='str'),
activate=dict(type='bool', default=False),
state=dict(type="str", default="enabled", choices=["disabled", "enabled"]),
name=dict(type="list", elements="str"),
activate=dict(type="bool", default=False),
),
required_one_of=[['name', 'activate']],
required_one_of=[["name", "activate"]],
supports_check_mode=True,
)
global AWALL_PATH
AWALL_PATH = module.get_bin_path('awall', required=True)
AWALL_PATH = module.get_bin_path("awall", required=True)
p = module.params
if p['name']:
if p['state'] == 'enabled':
enable_policy(module, p['name'], p['activate'])
elif p['state'] == 'disabled':
disable_policy(module, p['name'], p['activate'])
if p["name"]:
if p["state"] == "enabled":
enable_policy(module, p["name"], p["activate"])
elif p["state"] == "disabled":
disable_policy(module, p["name"], p["activate"])
if p['activate']:
if p["activate"]:
if not module.check_mode:
activate(module)
module.exit_json(changed=True, msg="activated awall rules")
@ -157,5 +157,5 @@ def main():
module.fail_json(msg="no action defined")
if __name__ == '__main__':
if __name__ == "__main__":
main()