Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipaclient_setup_automount with new install states #1208

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 17 additions & 3 deletions roles/ipaclient/library/ipaclient_setup_automount.py
Expand Up @@ -68,7 +68,8 @@

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ansible_ipa_client import (
setup_logging, check_imports, options, configure_automount
setup_logging, check_imports, options, configure_automount, sysrestore,
paths, getargspec
)


Expand All @@ -94,10 +95,23 @@ def main():
options.automount_location = module.params.get('automount_location')
options.location = options.automount_location

changed = False
if options.automount_location:
configure_automount(options)
changed = True
argspec = getargspec(configure_automount)
if len(argspec.args) > 1:
fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
statestore = sysrestore.StateFile(paths.IPA_CLIENT_SYSRESTORE)

module.exit_json(changed=True)
configure_automount(options, statestore)

# Reload the state as automount install may have modified it
fstore._load()
statestore._load()
else:
configure_automount(options)

module.exit_json(changed=changed)


if __name__ == '__main__':
Expand Down