diff options
author | Joel Diaz <jdiaz@redhat.com> | 2016-04-08 13:48:13 -0400 |
---|---|---|
committer | Joel Diaz <jdiaz@redhat.com> | 2016-04-15 09:35:54 -0400 |
commit | 3681ab5fb2a39ccb06024e6ad514ad50df21f9d2 (patch) | |
tree | 5d1dd7da5404f431a60241a419155204a7784dcc /roles/lib_yaml_editor/build/ansible | |
parent | 51e390459d7eda90c44d9ffd7f1199a3590beac1 (diff) | |
download | openshift-3681ab5fb2a39ccb06024e6ad514ad50df21f9d2.tar.gz openshift-3681ab5fb2a39ccb06024e6ad514ad50df21f9d2.tar.bz2 openshift-3681ab5fb2a39ccb06024e6ad514ad50df21f9d2.tar.xz openshift-3681ab5fb2a39ccb06024e6ad514ad50df21f9d2.zip |
cleanup roles after roles move to openshift-tools
also removing inventory/multi_inventory*
things left behind unchanged even though they were copied:
playbooks/adhoc/*
roles/dns
roles/kube_nfs_volumes
roles/os_update_latest
Diffstat (limited to 'roles/lib_yaml_editor/build/ansible')
-rw-r--r-- | roles/lib_yaml_editor/build/ansible/yedit.py | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/roles/lib_yaml_editor/build/ansible/yedit.py b/roles/lib_yaml_editor/build/ansible/yedit.py deleted file mode 100644 index dab3d6347..000000000 --- a/roles/lib_yaml_editor/build/ansible/yedit.py +++ /dev/null @@ -1,69 +0,0 @@ -#pylint: skip-file - -def main(): - ''' - ansible oc module for secrets - ''' - - module = AnsibleModule( - argument_spec=dict( - state=dict(default='present', type='str', - choices=['present', 'absent', 'list']), - debug=dict(default=False, type='bool'), - src=dict(default=None, type='str'), - content=dict(default=None, type='dict'), - key=dict(default=None, type='str'), - value=dict(default=None, type='str'), - value_format=dict(default='yaml', choices=['yaml', 'json'], type='str'), - ), - #mutually_exclusive=[["src", "content"]], - - supports_check_mode=True, - ) - state = module.params['state'] - - yamlfile = Yedit(module.params['src'], module.params['content']) - - rval = yamlfile.load() - if not rval and state != 'present': - module.fail_json(msg='Error opening file [%s]. Verify that the' + \ - ' file exists, that it is has correct permissions, and is valid yaml.') - - if state == 'list': - module.exit_json(changed=False, results=rval, state="list") - - if state == 'absent': - rval = yamlfile.delete(module.params['key']) - module.exit_json(changed=rval[0], results=rval[1], state="absent") - - if state == 'present': - - if module.params['value_format'] == 'yaml': - value = yaml.load(module.params['value']) - elif module.params['value_format'] == 'json': - value = json.loads(module.params['value']) - - if rval: - rval = yamlfile.put(module.params['key'], value) - if rval[0]: - yamlfile.write() - module.exit_json(changed=rval[0], results=rval[1], state="present") - - if not module.params['content']: - rval = yamlfile.create(module.params['key'], value) - else: - rval = yamlfile.load() - yamlfile.write() - - module.exit_json(changed=rval[0], results=rval[1], state="present") - - module.exit_json(failed=True, - changed=False, - results='Unknown state passed. %s' % state, - state="unknown") - -# pylint: disable=redefined-builtin, unused-wildcard-import, wildcard-import, locally-disabled -# import module snippets. This are required -from ansible.module_utils.basic import * - -main() |