2
# -*- coding: utf-8 -*-
4
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
6
# This file is part of Ansible
8
# Ansible is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# Ansible is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
26
short_description: Runs the discovery program I(facter) on the remote system
28
- Runs the I(facter) discovery program
29
(U(https://github.com/puppetlabs/facter)) on the remote system, returning
30
JSON data that can be useful for inventory purposes.
34
requirements: [ "facter", "ruby-json" ]
35
author: Michael DeHaan
39
# Example command-line invocation
40
ansible www.example.net -m facter
44
module = AnsibleModule(
45
argument_spec = dict()
48
cmd = ["/usr/bin/env", "facter", "--json"]
49
rc, out, err = module.run_command(cmd, check_rc=True)
50
module.exit_json(**json.loads(out))
52
# this is magic, see lib/ansible/module_common.py
53
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>