Ansible command is part of Ansible module
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:
Create 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 <target>
usage: fcpc ansible [-h] [--ansible.facts.dir ANSIBLE.FACTS.DIR] [--ansible.continue_on_error {0,1}]
[--ansible.index.interfaces {0,1}] [--ansible.index.packages {0,1}]
[--ansible.index.accounts {0,1}] [--ansible.index.dns {0,1}]
[--ansible.admin.group ANSIBLE.ADMIN.GROUP]
{import} [ansibleobjects ...]
positional arguments:
{import}
Choices:
import Import facts directory or file specified by next parameter
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.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)