diff --git a/plugins/modules/logrotate.py b/plugins/modules/logrotate.py index d376628ff7..43236bcfac 100644 --- a/plugins/modules/logrotate.py +++ b/plugins/modules/logrotate.py @@ -864,8 +864,8 @@ def main() -> None: module = AnsibleModule( argument_spec=dict( name=dict(type="str", required=True, aliases=["config_name"]), - state=dict(type="str", default="present", choices=["present", "absent"]), - config_dir=dict(type="path", default="/etc/logrotate.d"), + state=dict(type="str", choices=["present", "absent"]), + config_dir=dict(type="path"), paths=dict(type="list", elements="path"), rotation_period=dict( type="str", @@ -920,6 +920,7 @@ def main() -> None: ) logrotate_bin = module.get_bin_path("logrotate", required=True) + logrotate_config = LogrotateConfig(module, logrotate_bin) result = logrotate_config.apply() module.exit_json(**result)