ansible-community / ara-web

Stateless web client for the ARA Records Ansible API.
https://ara.recordsansible.org
GNU General Public License v3.0
37 stars 8 forks source link

Implement host facts view #4

Open dmsimard opened 5 years ago

dmsimard commented 5 years ago

Host facts should be available when clicking on a host. They are available in the detailed view of a host, for example:

{
    "id": 4,
    "playbook": {
        "id": 1,
        "duration": "38.40244",
        "started": "2019-04-17T13:17:18.334437",
        "ended": "2019-04-17T13:17:56.736877",
        "name": null,
        "status": "failed",
        "path": "/home/dmsimard/dev/sandbox/update-packages.yaml"
    },
    "facts": {
        "ansible_all_ipv4_addresses": [
            "192.168.200.14"
        ],
        "ansible_all_ipv6_addresses": [
            "fe80::f816:3eff:febc:2978"
        ],
        "ansible_apparmor": {
            "status": "disabled"
        },
        "ansible_architecture": "x86_64",
        "ansible_bios_date": "04/01/2014",
        "ansible_bios_version": "1.11.0-2.el7",
        "ansible_cmdline": {
            "BOOT_IMAGE": "/boot/vmlinuz-3.10.0-957.1.3.el7.x86_64",
            "LANG": "en_US.UTF-8",
            "console": "ttyS0,115200",
            "crashkernel": "auto",
            "ro": true,
            "root": "UUID=f41e390f-835b-4223-a9bb-9b45984ddf8d"
        },
        "ansible_date_time": {
            "date": "2019-04-17",
            "day": "17",
            "epoch": "1555521440",
            "hour": "17",
            "iso8601": "2019-04-17T17:17:20Z",
            "iso8601_basic": "20190417T171720675558",
            "iso8601_basic_short": "20190417T171720",
            "iso8601_micro": "2019-04-17T17:17:20.675764Z",
            "minute": "17",
            "month": "04",
            "second": "20",
            "time": "17:17:20",
            "tz": "UTC",
            "tz_offset": "+0000",
            "weekday": "Wednesday",
            "weekday_number": "3",
            "weeknumber": "15",
            "year": "2019"
        },
        "ansible_default_ipv4": {
            "address": "192.168.200.14",
            "alias": "eth0",
            "broadcast": "192.168.200.255",
            "gateway": "192.168.200.1",
            "interface": "eth0",
            "macaddress": "fa:16:3e:bc:29:78",
            "mtu": 1450,
            "netmask": "255.255.255.0",
            "network": "192.168.200.0",
            "type": "ether"
        },
        "ansible_default_ipv6": {},
        "ansible_device_links": {
            "ids": {},
            "labels": {},
            "masters": {},
            "uuids": {
                "vda1": [
                    "f41e390f-835b-4223-a9bb-9b45984ddf8d"
                ]
            }
        },
        "ansible_devices": {
            "vda": {
                "holders": [],
                "host": "",
                "links": {
                    "ids": [],
                    "labels": [],
                    "masters": [],
                    "uuids": []
                },
                "model": null,
                "partitions": {
                    "vda1": {
                        "holders": [],
                        "links": {
                            "ids": [],
                            "labels": [],
                            "masters": [],
                            "uuids": [
                                "f41e390f-835b-4223-a9bb-9b45984ddf8d"
                            ]
                        },
                        "sectors": "20969439",
                        "sectorsize": 512,
                        "size": "10.00 GB",
                        "start": "2048",
                        "uuid": "f41e390f-835b-4223-a9bb-9b45984ddf8d"
                    }
                },
                "removable": "0",
                "rotational": "1",
                "sas_address": null,
                "sas_device_handle": null,
                "scheduler_mode": "mq-deadline",
                "sectors": "20971520",
                "sectorsize": "512",
                "size": "10.00 GB",
                "support_discard": "0",
                "vendor": "0x1af4",
                "virtual": 1
            }
        },
        "ansible_distribution": "CentOS",
        "ansible_distribution_file_parsed": true,
        "ansible_distribution_file_path": "/etc/redhat-release",
        "ansible_distribution_file_variety": "RedHat",
        "ansible_distribution_major_version": "7",
        "ansible_distribution_release": "Core",
        "ansible_distribution_version": "7.6.1810",
        "ansible_dns": {
            "nameservers": [
                "1.1.1.1",
                "8.8.8.8"
            ],
            "search": [
                "openstacklocal"
            ]
        },
        "ansible_domain": "novalocal",
        "ansible_effective_group_id": 1000,
        "ansible_effective_user_id": 1000,
        "ansible_env": "Not saved by ARA as configured by 'ignored_facts'",
        "ansible_eth0": {
            "active": true,
            "device": "eth0",
            "features": {
                "busy_poll": "off [fixed]",
                "fcoe_mtu": "off [fixed]",
                "generic_receive_offload": "on",
                "generic_segmentation_offload": "on",
                "highdma": "on [fixed]",
                "hw_tc_offload": "off [fixed]",
                "l2_fwd_offload": "off [fixed]",
                "large_receive_offload": "off [fixed]",
                "loopback": "off [fixed]",
                "netns_local": "off [fixed]",
                "ntuple_filters": "off [fixed]",
                "receive_hashing": "off [fixed]",
                "rx_all": "off [fixed]",
                "rx_checksumming": "on [fixed]",
                "rx_fcs": "off [fixed]",
                "rx_gro_hw": "off [fixed]",
                "rx_udp_tunnel_port_offload": "off [fixed]",
                "rx_vlan_filter": "on [fixed]",
                "rx_vlan_offload": "off [fixed]",
                "rx_vlan_stag_filter": "off [fixed]",
                "rx_vlan_stag_hw_parse": "off [fixed]",
                "scatter_gather": "on",
                "tcp_segmentation_offload": "on",
                "tx_checksum_fcoe_crc": "off [fixed]",
                "tx_checksum_ip_generic": "on",
                "tx_checksum_ipv4": "off [fixed]",
                "tx_checksum_ipv6": "off [fixed]",
                "tx_checksum_sctp": "off [fixed]",
                "tx_checksumming": "on",
                "tx_fcoe_segmentation": "off [fixed]",
                "tx_gre_csum_segmentation": "off [fixed]",
                "tx_gre_segmentation": "off [fixed]",
                "tx_gso_partial": "off [fixed]",
                "tx_gso_robust": "off [fixed]",
                "tx_ipip_segmentation": "off [fixed]",
                "tx_lockless": "off [fixed]",
                "tx_nocache_copy": "off",
                "tx_scatter_gather": "on",
                "tx_scatter_gather_fraglist": "off [fixed]",
                "tx_sctp_segmentation": "off [fixed]",
                "tx_sit_segmentation": "off [fixed]",
                "tx_tcp6_segmentation": "on",
                "tx_tcp_ecn_segmentation": "on",
                "tx_tcp_mangleid_segmentation": "off",
                "tx_tcp_segmentation": "on",
                "tx_udp_tnl_csum_segmentation": "off [fixed]",
                "tx_udp_tnl_segmentation": "off [fixed]",
                "tx_vlan_offload": "off [fixed]",
                "tx_vlan_stag_hw_insert": "off [fixed]",
                "udp_fragmentation_offload": "on",
                "vlan_challenged": "off [fixed]"
            },
            "hw_timestamp_filters": [],
            "ipv4": {
                "address": "192.168.200.14",
                "broadcast": "192.168.200.255",
                "netmask": "255.255.255.0",
                "network": "192.168.200.0"
            },
            "ipv6": [
                {
                    "address": "fe80::f816:3eff:febc:2978",
                    "prefix": "64",
                    "scope": "link"
                }
            ],
            "macaddress": "fa:16:3e:bc:29:78",
            "module": "virtio_net",
            "mtu": 1450,
            "pciid": "virtio0",
            "promisc": false,
            "timestamping": [
                "rx_software",
                "software"
            ],
            "type": "ether"
        },
        "ansible_fips": false,
        "ansible_form_factor": "Other",
        "ansible_fqdn": "live-demo-10.novalocal",
        "ansible_hostname": "live-demo-10",
        "ansible_interfaces": [
            "lo",
            "eth0"
        ],
        "ansible_is_chroot": true,
        "ansible_iscsi_iqn": "",
        "ansible_kernel": "3.10.0-957.1.3.el7.x86_64",
        "ansible_lo": {
            "active": true,
            "device": "lo",
            "features": {
                "busy_poll": "off [fixed]",
                "fcoe_mtu": "off [fixed]",
                "generic_receive_offload": "on",
                "generic_segmentation_offload": "on",
                "highdma": "on [fixed]",
                "hw_tc_offload": "off [fixed]",
                "l2_fwd_offload": "off [fixed]",
                "large_receive_offload": "off [fixed]",
                "loopback": "on [fixed]",
                "netns_local": "on [fixed]",
                "ntuple_filters": "off [fixed]",
                "receive_hashing": "off [fixed]",
                "rx_all": "off [fixed]",
                "rx_checksumming": "on [fixed]",
                "rx_fcs": "off [fixed]",
                "rx_gro_hw": "off [fixed]",
                "rx_udp_tunnel_port_offload": "off [fixed]",
                "rx_vlan_filter": "off [fixed]",
                "rx_vlan_offload": "off [fixed]",
                "rx_vlan_stag_filter": "off [fixed]",
                "rx_vlan_stag_hw_parse": "off [fixed]",
                "scatter_gather": "on",
                "tcp_segmentation_offload": "on",
                "tx_checksum_fcoe_crc": "off [fixed]",
                "tx_checksum_ip_generic": "on [fixed]",
                "tx_checksum_ipv4": "off [fixed]",
                "tx_checksum_ipv6": "off [fixed]",
                "tx_checksum_sctp": "on [fixed]",
                "tx_checksumming": "on",
                "tx_fcoe_segmentation": "off [fixed]",
                "tx_gre_csum_segmentation": "off [fixed]",
                "tx_gre_segmentation": "off [fixed]",
                "tx_gso_partial": "off [fixed]",
                "tx_gso_robust": "off [fixed]",
                "tx_ipip_segmentation": "off [fixed]",
                "tx_lockless": "on [fixed]",
                "tx_nocache_copy": "off [fixed]",
                "tx_scatter_gather": "on [fixed]",
                "tx_scatter_gather_fraglist": "on [fixed]",
                "tx_sctp_segmentation": "on",
                "tx_sit_segmentation": "off [fixed]",
                "tx_tcp6_segmentation": "on",
                "tx_tcp_ecn_segmentation": "on",
                "tx_tcp_mangleid_segmentation": "on",
                "tx_tcp_segmentation": "on",
                "tx_udp_tnl_csum_segmentation": "off [fixed]",
                "tx_udp_tnl_segmentation": "off [fixed]",
                "tx_vlan_offload": "off [fixed]",
                "tx_vlan_stag_hw_insert": "off [fixed]",
                "udp_fragmentation_offload": "on",
                "vlan_challenged": "on [fixed]"
            },
            "hw_timestamp_filters": [],
            "ipv4": {
                "address": "127.0.0.1",
                "broadcast": "host",
                "netmask": "255.0.0.0",
                "network": "127.0.0.0"
            },
            "ipv6": [
                {
                    "address": "::1",
                    "prefix": "128",
                    "scope": "host"
                }
            ],
            "mtu": 65536,
            "promisc": false,
            "timestamping": [
                "rx_software",
                "software"
            ],
            "type": "loopback"
        },
        "ansible_local": {},
        "ansible_lsb": {},
        "ansible_machine": "x86_64",
        "ansible_machine_id": "05cb8c7b39fe0f70e3ce97e5beab809d",
        "ansible_memfree_mb": 427,
        "ansible_memory_mb": {
            "nocache": {
                "free": 819,
                "used": 172
            },
            "real": {
                "free": 427,
                "total": 991,
                "used": 564
            },
            "swap": {
                "cached": 0,
                "free": 0,
                "total": 0,
                "used": 0
            }
        },
        "ansible_memtotal_mb": 991,
        "ansible_mounts": [
            {
                "block_available": 2268995,
                "block_size": 4096,
                "block_total": 2618560,
                "block_used": 349565,
                "device": "/dev/vda1",
                "fstype": "xfs",
                "inode_available": 5211455,
                "inode_total": 5242240,
                "inode_used": 30785,
                "mount": "/",
                "options": "rw,seclabel,relatime,attr2,inode64,noquota",
                "size_available": 9293803520,
                "size_total": 10725621760,
                "uuid": "f41e390f-835b-4223-a9bb-9b45984ddf8d"
            }
        ],
        "ansible_nodename": "live-demo-10.novalocal",
        "ansible_os_family": "RedHat",
        "ansible_pkg_mgr": "yum",
        "ansible_processor": [
            "0",
            "GenuineIntel",
            "Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz"
        ],
        "ansible_processor_cores": 1,
        "ansible_processor_count": 1,
        "ansible_processor_threads_per_core": 1,
        "ansible_processor_vcpus": 1,
        "ansible_product_name": "OpenStack Compute",
        "ansible_product_serial": "NA",
        "ansible_product_uuid": "NA",
        "ansible_product_version": "18.1.0-1.el7",
        "ansible_python": {
            "executable": "/usr/bin/python",
            "has_sslcontext": true,
            "type": "CPython",
            "version": {
                "major": 2,
                "micro": 5,
                "minor": 7,
                "releaselevel": "final",
                "serial": 0
            },
            "version_info": [
                2,
                7,
                5,
                "final",
                0
            ]
        },
        "ansible_python_version": "2.7.5",
        "ansible_real_group_id": 1000,
        "ansible_real_user_id": 1000,
        "ansible_selinux": {
            "config_mode": "enforcing",
            "mode": "enforcing",
            "policyvers": 31,
            "status": "enabled",
            "type": "targeted"
        },
        "ansible_selinux_python_present": true,
        "ansible_service_mgr": "systemd",
        "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJbu1863a+rbIrlNQ9DWIZ4DMw7mhnKi/c1GbMEpi/0XSQj0nSmhxyZKuy9PSAObn/a5b+R1FJiuAj7QW7SB1Dc=",
        "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIKpCEU8pvrBKiRDw+8OEmOWEYsg29NpHWZW6JUS+GoWf",
        "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQC1Ab2tSEqE2R/1OCJC3EIdkuiMOlQ/OBeaN9KKFfxlUs/VKJJnP1I+mnbx/BufQznceVR6pV+RlVjTT/B2C5iFTPv91V0rTIMs1YQUQoB8GyYrE9mvE3gGn87WFJusVkFXIRSpgk4kPydAydVV3QFu0p8kusGSPlSNxHhvr/Mx5J7EEdj17snXz8A/Jar+FL5SeYiwsCUrFkZSBlqyjRWmf/dJmSBJ3mZztESKfb7fcTqyEtLxY5AbMBoF+wHP8SbAUOHl9muaeUtt7VyP4RMpZ6bgsqdT2X3gkPGEN2SolyHLZYH+hR25ovMup5vf8fg1w7M1BfyP1+GeQsv3UMgz",
        "ansible_swapfree_mb": 0,
        "ansible_swaptotal_mb": 0,
        "ansible_system": "Linux",
        "ansible_system_capabilities": [
            ""
        ],
        "ansible_system_capabilities_enforced": "True",
        "ansible_system_vendor": "RDO",
        "ansible_uptime_seconds": 9084,
        "ansible_user_dir": "/home/centos",
        "ansible_user_gecos": "Cloud User",
        "ansible_user_gid": 1000,
        "ansible_user_id": "centos",
        "ansible_user_shell": "/bin/bash",
        "ansible_user_uid": 1000,
        "ansible_userspace_architecture": "x86_64",
        "ansible_userspace_bits": "64",
        "ansible_virtualization_role": "guest",
        "ansible_virtualization_type": "openstack",
        "gather_subset": [
            "all"
        ],
        "module_setup": true
    },
    "created": "2019-04-17T13:17:20.945787",
    "updated": "2019-04-17T13:17:54.243384",
    "name": "live-demo-10",
    "alias": null,
    "changed": 1,
    "failed": 0,
    "ok": 3,
    "skipped": 0,
    "unreachable": 0
}