Sha256: 225400f1e8bacd82aff50867d137f07b14a7bf535e7405956a1fd79f1d37c349

Contents?: true

Size: 788 Bytes

Versions: 18

Compression:

Stored size: 788 Bytes

Contents

#!/usr/bin/python

import subprocess

def main():
    module = AnsibleModule(
        argument_spec = dict(
        ),
        supports_check_mode = False,
    )

    
    facts = {}
    
    d = {
        'git_user_name': ['git', 'config', 'user.name'],
        'git_user_email': ['git', 'config', 'user.email'],
    }
    
    for key, cmd in d.iteritems():        
        try:
            facts[key] = subprocess.check_output(cmd).rstrip()
        except subprocess.CalledProcessError as e:
            pass        
        
    changed = False

    module.exit_json(
        changed = changed,
        ansible_facts = facts,
    )

# import module snippets
from ansible.module_utils.basic import *
from ansible.module_utils.known_hosts import *

if __name__ == '__main__':
    main()

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
qb-0.1.17 library/qb_facts.py
qb-0.1.16 library/qb_facts.py
qb-0.1.15 library/qb_facts.py
qb-0.1.14 library/qb_facts.py
qb-0.1.13 library/qb_facts.py
qb-0.1.12 library/qb_facts.py
qb-0.1.11 library/qb_facts.py
qb-0.1.10 library/qb_facts.py
qb-0.1.9 library/qb_facts.py
qb-0.1.8 library/qb_facts.py
qb-0.1.7 library/qb_facts.py
qb-0.1.6 library/qb_facts.py
qb-0.1.5 library/qb_facts.py
qb-0.1.4 library/qb_facts.py
qb-0.1.3 library/qb_facts.py
qb-0.1.2 library/qb_facts.py
qb-0.1.1 library/qb_facts.py
qb-0.1.0 library/qb_facts.py