New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ovirt: Add dynamic inventory for oVirt hosts #22486

Open
wants to merge 1 commit into
base: devel
from

Conversation

@machacekondra
Contributor

machacekondra commented Mar 10, 2017

SUMMARY

This PR add new dynamic inventory script for oVirt hosts.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

ovirt4_hosts

ANSIBLE VERSION
2.3.0
ADDITIONAL INFORMATION

@machacekondra machacekondra force-pushed the machacekondra:ovirt_hosts_dyn_inv branch Mar 10, 2017

@machacekondra

This comment has been minimized.

Contributor

machacekondra commented Mar 10, 2017

$ python3 ovirt4_hosts.py --pretty
{
  "_meta": {
    "hostvars": {
      "host": {
        "address": "10.34.60.197",
        "affinity_groups": [],
        "affinity_labels": [],
        "ansible_host": "10.34.60.197",
        "cluster": "Default",
        "description": null,
        "devices": [
          "net_eth3_00_1a_4a_d0_40_39",
          "usb_1_0_1_0",
          "pci_0000_00_0a_0",
          "usb_usb1",
          "net_ovs_system_b2_a7_52_26_81_d1",
          "scsi_target1_0_0",
          "computer",
          "net_eth0_00_1a_4a_d0_40_13",
          "net_lo_00_00_00_00_00_00",
          "usb_1_1_1_0",
          "pci_0000_00_01_0",
          "pci_0000_00_00_0",
          "pci_0000_00_03_0",
          "pci_0000_00_01_2",
          "pci_0000_00_02_0",
          "pci_0000_00_01_1",
          "pci_0000_00_05_0",
          "pci_0000_00_04_0",
          "pci_0000_00_01_3",
          "pci_0000_00_07_0",
          "scsi_generic_sg0",
          "pci_0000_00_06_0",
          "pci_0000_00_09_0",
          "pci_0000_00_08_0",
          "scsi_host1",
          "scsi_host2",
          "usb_1_1",
          "scsi_1_0_0_0",
          "net_eth2_00_1a_4a_d0_40_38",
          "block_sr0_QEMU_DVD_ROM_QM00003",
          "scsi_host0",
          "net_br_int_3e_0b_6a_5b_5d_46",
          "net_eth1_00_1a_4a_d0_40_1c",
          "block_vda_e95448ef_9b97_44ea_b"
        ],
        "id": "895fbeaa-cfe5-4019-a4c2-f46c343b190e",
        "name": "host",
        "os_type": "RHEL",
        "statistics": {
          "boot.time": 1485963819.0,
          "cpu.current.idle": 0.0,
          "cpu.current.system": 0.0,
          "cpu.current.user": 0.0,
          "cpu.load.avg.5m": 0.0,
          "ksm.cpu.current": 0.0,
          "memory.buffers": 0.0,
          "memory.cached": 0.0,
          "memory.free": 1859125248.0,
          "memory.shared": 0.0,
          "memory.total": 1859125248.0,
          "memory.used": 0.0,
          "swap.cached": 0.0,
          "swap.free": 2112880640.0,
          "swap.total": 2146435072.0,
          "swap.used": 33554432.0
        },
        "status": "maintenance",
        "tags": []
      },
      "host2": {
        "address": "192.168.200.11",
        "affinity_groups": [],
        "affinity_labels": [],
        "ansible_host": "192.168.200.11",
        "cluster": "cl-41",
        "description": null,
        "devices": [
          "pci_0000_00_06_0",
          "scsi_host1",
          "block_vda",
          "net_eth0_52_54_00_52_c6_62",
          "usb_1_0_1_0",
          "usb_usb1",
          "computer",
          "net_lo_00_00_00_00_00_00",
          "net_eth1_52_54_00_dd_1a_53",
          "pci_0000_00_01_0",
          "scsi_host0",
          "pci_0000_00_00_0",
          "pci_0000_00_01_2",
          "pci_0000_00_03_0",
          "pci_0000_00_02_0",
          "pci_0000_00_01_1",
          "pci_0000_00_05_0",
          "pci_0000_00_01_3",
          "pci_0000_00_04_0"
        ],
        "id": "83d7ba65-608c-4375-bb1c-7e8e12728a28",
        "name": "host2",
        "os_type": "RHEL",
        "statistics": {
          "boot.time": 1488997709.0,
          "cpu.current.idle": 0.0,
          "cpu.current.system": 0.0,
          "cpu.current.user": 0.0,
          "cpu.load.avg.5m": 0.0,
          "ksm.cpu.current": 0.0,
          "memory.buffers": 0.0,
          "memory.cached": 0.0,
          "memory.free": 1907359744.0,
          "memory.shared": 0.0,
          "memory.total": 1907359744.0,
          "memory.used": 0.0,
          "swap.cached": 0.0,
          "swap.free": 1609564160.0,
          "swap.total": 1609564160.0,
          "swap.used": 0.0
        },
        "status": "maintenance",
        "tags": []
      },
      "host3": {
        "address": "192.168.200.12",
        "affinity_groups": [],
        "affinity_labels": [],
        "ansible_host": "192.168.200.12",
        "cluster": "cl-41",
        "description": null,
        "devices": [
          "pci_0000_00_06_0",
          "scsi_host1",
          "block_vda",
          "net_eth1_52_54_00_ca_f4_0a",
          "usb_1_0_1_0",
          "usb_usb1",
          "computer",
          "net_lo_00_00_00_00_00_00",
          "pci_0000_00_01_0",
          "scsi_host0",
          "pci_0000_00_00_0",
          "pci_0000_00_01_2",
          "pci_0000_00_03_0",
          "pci_0000_00_02_0",
          "pci_0000_00_01_1",
          "pci_0000_00_05_0",
          "net_eth0_52_54_00_bb_3b_95",
          "pci_0000_00_01_3",
          "pci_0000_00_04_0"
        ],
        "id": "ee2bbc52-73a7-4875-bad1-6f7ff259b677",
        "name": "host3",
        "os_type": "RHEL",
        "statistics": {
          "boot.time": 1489134332.0,
          "cpu.current.idle": 99.0,
          "cpu.current.system": 0.0,
          "cpu.current.user": 1.0,
          "cpu.load.avg.5m": 0.06,
          "ksm.cpu.current": 0.0,
          "memory.buffers": 0.0,
          "memory.cached": 0.0,
          "memory.free": 1583108588.0,
          "memory.shared": 0.0,
          "memory.total": 1907359744.0,
          "memory.used": 324251156.0,
          "swap.cached": 0.0,
          "swap.free": 1609564160.0,
          "swap.total": 1609564160.0,
          "swap.used": 0.0
        },
        "status": "up",
        "tags": []
      }
    }
  },
  "cluster_Default": [
    "host"
  ],
  "cluster_cl-41": [
    "host2",
    "host3"
  ],
  "status_maintenance": [
    "host",
    "host2"
  ],
  "status_up": [
    "host3"
  ]
}
@ansibot

This comment has been minimized.

Contributor

ansibot commented Mar 10, 2017

The test ansible-test sanity --test pep8 failed with the following errors:

contrib/inventory/ovirt4_hosts.py:67:40: W291 trailing whitespace
contrib/inventory/ovirt4_hosts.py:69:24: W291 trailing whitespace
contrib/inventory/rhv_hosts.py:67:40: W291 trailing whitespace
contrib/inventory/rhv_hosts.py:69:24: W291 trailing whitespace

click here for bot help

@machacekondra machacekondra force-pushed the machacekondra:ovirt_hosts_dyn_inv branch Mar 10, 2017

@ansibot ansibot removed the needs_revision label Mar 10, 2017

@machacekondra

This comment has been minimized.

Contributor

machacekondra commented Mar 10, 2017

shipit

@machacekondra

This comment has been minimized.

Contributor

machacekondra commented Mar 10, 2017

@machacekondra

This comment has been minimized.

Contributor

machacekondra commented Mar 10, 2017

@jctanner

This comment has been minimized.

Member

jctanner commented Mar 10, 2017

@machacekondra machacekondra force-pushed the machacekondra:ovirt_hosts_dyn_inv branch to e0017fe Mar 13, 2017

@ryansb

ryansb approved these changes Mar 21, 2017

@mwperina

shipit

@machacekondra

This comment has been minimized.

Contributor

machacekondra commented Oct 4, 2017

bot_status

@ansibot

This comment has been minimized.

Contributor

ansibot commented Oct 4, 2017

waiting_on: maintainer
component: None
supported_by: core
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): False
community_shipits (namespace maintainers): False
ansible_shipits (core team members): False
shipit_actors (maintainer or core team member): None
shipit_actors_other:

click here for bot help

@ansibot ansibot added feature and removed feature_pull_request labels Mar 2, 2018

@maxamillion

This comment has been minimized.

Contributor

maxamillion commented Sep 20, 2018

rebuild_merge

@ansibot ansibot removed the stale_ci label Sep 20, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Sep 20, 2018

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

contrib/inventory/ovirt4_hosts.py:265:1: E305 expected 2 blank lines after class or function definition, found 1

click here for bot help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment