Skip to content
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

feat: add hostvars_prefix and hostvars_suffix options to inventory hostvars #423

Merged
merged 4 commits into from
Dec 15, 2023

Conversation

jooola
Copy link
Collaborator

@jooola jooola commented Dec 13, 2023

SUMMARY

Add hostvars_prefix and hostvars_suffix options to customize the inventory host variables keys.

For example, with hostvars_prefix: hcloud_ , the host vars will be stored as follows:

{
    "_meta": {
        "hostvars": {
            "tmp": {
                "ansible_host": "65.109.169.27",
                "hcloud_architecture": "x86",
                "hcloud_datacenter": "hel1-dc2",
                "hcloud_id": 40573407,
                "hcloud_image_id": 114690387,
                "hcloud_image_name": "debian-12",
                "hcloud_image_os_flavor": "debian",
                "hcloud_ipv4": "65.109.169.27",
                "hcloud_ipv6_network_mask": "64",
                "hcloud_ipv6_network": "2a01:4f9:c012:4377::",
                "hcloud_ipv6": "2a01:4f9:c012:4377::1",
                "hcloud_labels": {},
                "hcloud_location": "hel1",
                "hcloud_name": "tmp",
                "hcloud_private_networks": [],
                "hcloud_server_type": "cx11",
                "hcloud_status": "running",
                "hcloud_type": "cx11"
            }
        }
    }
}

Related to #116

@jooola jooola changed the title feat: add hostvars_prefix and hostvars_suffix` options to inventory host variables feat: add hostvars_prefix and hostvars_suffix` options to inventory hostvars Dec 13, 2023
@jooola jooola changed the title feat: add hostvars_prefix and hostvars_suffix` options to inventory hostvars feat: add hostvars_prefix and hostvars_suffix options to inventory hostvars Dec 13, 2023
Copy link
Collaborator

@apricote apricote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@jooola jooola merged commit 4e3f89a into ansible-collections:main Dec 15, 2023
29 of 30 checks passed
@jooola jooola deleted the inventory_hostvar_prefix branch December 15, 2023 14:40
jooola pushed a commit that referenced this pull request Feb 2, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.5.0](2.4.1...2.5.0)
(2024-02-02)


### Features

* add `hostvars_prefix` and `hostvars_suffix` options to inventory
hostvars
([#423](#423))
([4e3f89a](4e3f89a))
* allow forcing the deletion of firewalls that are still in use
([#447](#447))
([559d315](559d315))
* improve firewall resources management
([#324](#324))
([2757fe7](2757fe7))
* replace `ansible.netcommon` utils with python3 `ipaddress` module
([#416](#416))
([4cfdf50](4cfdf50))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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

Successfully merging this pull request may close these issues.

2 participants