usage: fcpc ansible [-h] [--ansible.facts.dir ANSIBLE.FACTS.DIR]
[--ansible.continue_on_error {0,1}]
[--ansible.index.interfaces {0,1}]
[--ansible.index.networks {0,1}]
[--ansible.index.packages {0,1}]
[--ansible.index.accounts {0,1}]
[--ansible.index.dns {0,1}]
[--ansible.admin.group ANSIBLE.ADMIN.GROUP]
[--ansible.query.inventory_hosts ANSIBLE.QUERY.INVENTORY_HOSTS]
[--ansible.query.inventory_group ANSIBLE.QUERY.INVENTORY_GROUP]
[--ansible.query.inventory_ip ANSIBLE.QUERY.INVENTORY_IP]
[--ansible.query.inventory_tag ANSIBLE.QUERY.INVENTORY_TAG]
[--ansible.filter.ipnet ANSIBLE.FILTER.IPNET]
[--ansible.host.attribute ANSIBLE.HOST.ATTRIBUTE]
[--ansible.name.attribute ANSIBLE.NAME.ATTRIBUTE]
[--ansible.custom.attribute ANSIBLE.CUSTOM.ATTRIBUTE]
[--ansible.custom.group ANSIBLE.CUSTOM.GROUP]
[--ansible.preferred.object ANSIBLE.PREFERRED.OBJECT]
{import,download-and-import-all,generate-playbook,generate-inventory}
[ansibleobjects ...]
positional arguments:
{import,download-and-import-all,generate-playbook,generate-inventory}
Choices:
import Import facts directory or file specified by next
parameter
download-and-import-all
Run import
generate-playbook Generate playbook
generate-inventory Generate ansible inventory
ansibleobjects
optional arguments:
-h, --help show this help message and exit
--ansible.facts.dir ANSIBLE.FACTS.DIR
Ansible gathered facts
directory[Defined:fcplib.module.ansible.cmd] (default:
None)
--ansible.continue_on_error {0,1}
Continue on error within
ansible[Defined:fcplib.module.ansible.cmd] (default:
0)
Choices:
0
1
--ansible.index.interfaces {0,1}
Index interfaces from
ansible[Defined:fcplib.module.ansible.cmd] (default:
1)
Choices:
0
1
--ansible.index.networks {0,1}
Index networks behind interfaces from
ansible[Defined:fcplib.module.ansible.cmd] (default:
1)
Choices:
0
1
--ansible.index.packages {0,1}
Index packages from
ansible[Defined:fcplib.module.ansible.cmd] (default:
1)
Choices:
0
1
--ansible.index.accounts {0,1}
Index accounts from
ansible[Defined:fcplib.module.ansible.cmd] (default:
1)
Choices:
0
1
--ansible.index.dns {0,1}
Index DNS server linkage from
ansible[Defined:fcplib.module.ansible.cmd] (default:
1)
Choices:
0
1
--ansible.admin.group ANSIBLE.ADMIN.GROUP
Admin group on systems. These groups will be tagged as
privileged within
platform[Defined:fcplib.module.ansible.cmd] (default:
sudo)
--ansible.query.inventory_hosts ANSIBLE.QUERY.INVENTORY_HOSTS
Query to search to generate
inventory[Defined:fcplib.module.ansible.cmd] (default:
host+/{ ((ip:* AND hostname:*) OR fqdn:*) }/)
--ansible.query.inventory_group ANSIBLE.QUERY.INVENTORY_GROUP
Query[ies] to search groups for
hosts[Defined:fcplib.module.ansible.cmd] (default:
['{url} ~is-in group+'])
--ansible.query.inventory_ip ANSIBLE.QUERY.INVENTORY_IP
Query[ies] to search IPs for
hosts[Defined:fcplib.module.ansible.cmd] (default:
None)
--ansible.query.inventory_tag ANSIBLE.QUERY.INVENTORY_TAG
Tag[s] to search groups for
hosts[Defined:fcplib.module.ansible.cmd] (default:
['organization=', 'location=', 'os:', 'vendor/',
'platform:'])
--ansible.filter.ipnet ANSIBLE.FILTER.IPNET
If set, you can filter only hosts within this IP
network.[Defined:fcplib.module.ansible.cmd] (default:
None)
--ansible.host.attribute ANSIBLE.HOST.ATTRIBUTE
Attribute used as
ansible_host[Defined:fcplib.module.ansible.cmd]
(default: ip)
--ansible.name.attribute ANSIBLE.NAME.ATTRIBUTE
Attribute used as
hostname[Defined:fcplib.module.ansible.cmd] (default:
hostname)
--ansible.custom.attribute ANSIBLE.CUSTOM.ATTRIBUTE
Custom attribute to be used in form 'tag name value'.
If tag matches, attribute with name and value is
added.[Defined:fcplib.module.ansible.cmd] (default:
None)
--ansible.custom.group ANSIBLE.CUSTOM.GROUP
Custom group to be used in form 'tag name'. If tag
matches, host will be added to group
name[Defined:fcplib.module.ansible.cmd] (default:
None)
--ansible.preferred.object ANSIBLE.PREFERRED.OBJECT
Preferred object type for group
'all'[Defined:fcplib.module.ansible.cmd] (default:
ansiblehost)
This module imports facts gathered by Ansible about hosts into model.
You need to have ansible installed and configured. Module will not run any ansible command. It just imports data gathered by Ansible.
If you want to automatize gathering data, you need to use some external script which is not part of the platform.
Now, module supports these data:
Creare gather.yml:
---
- hosts: all
tasks:
- name: gather packages
ansible.builtin.package_facts:
strategy: first
- name: gather all
ansible.builtin.setup:
gather_subset: all
- name: gather info
local_action:
module: copy
content: "{{ ansible_facts }}"
dest: "facts/{{inventory_hostname}}.json"
Gather data from ansible:
ansible-playbook gather.yml -l all
Run import task for platform,
set --ansible.facts.dir to facts directory used by ansible and run
fcpc ansible import