Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- def main():
- module = AnsibleModule(
- argument_spec = dict(
- state = dict(default='present', choices=['present', 'absent']),
- name = dict(required=True),
- ),
- supports_check_mode = True,
- )
- f=open('/tmp/foo','w')
- name=module.params['name']
- if type(name) == type(''):
- f.write(module.params['name'])
- elif type(name) == type({}):
- for k in name.keys():
- f.write('%s %s ' % (k,name[k]))
- elif type(name) == type([]):
- for k in name:
- f.write('%s ' % (k))
- f.close()
- module.exit_json(changed=True)
- # import module snippets
- from ansible.module_utils.basic import *
- main()
Advertisement
Add Comment
Please, Sign In to add comment