Skip to content

Inventory: Add host var and group to distinguish virtual machines #199

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

Closed
DouglasHeriot opened this issue May 11, 2020 · 1 comment
Closed

Comments

@DouglasHeriot
Copy link
Contributor

ISSUE TYPE
  • Feature Idea
SUMMARY

Currently the only way to distinguish a "device" from a "virtual machine" in the Inventory is to look for the presence of "device_type" host var. There's no easy way to create a group based on this when I need to write a playbook that only operates on VMs, or only on physical devices.

  • I propose an "is_virtual" host var be created and added to all hosts as True or False.
  • A group is_virtual could optionally be created with a new group_by option.
EXPECTED RESULTS
            "test100": {
                "device_type": "cisco-test",
                "is_virtual": false,
                "manufacturer": "cisco",
                "role": "core-switch",
                "site": "test-site",
                "tags": []
            },
            "test104-vm": {
                "cluster": "Test Cluster 2",
                "cluster_type": "test-cluster-type",
                "is_virtual": true,
                "tags": []
            }
ACTUAL RESULTS
            "test100": {
                "device_type": "cisco-test",
                "manufacturer": "cisco",
                "role": "core-switch",
                "site": "test-site",
                "tags": []
            },
            "test104-vm": {
                "cluster": "Test Cluster 2",
                "cluster_type": "test-cluster-type",
                "tags": []
            }
@FragmentedPacket
Copy link
Contributor

Fixed via #202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants