You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario: Using Ansible to both create VMs and configure them. Consistency in hostname generation is critical to ensure seamless transitions between creation and configuration phases.
Solution: By enabling the ansible.builtin.generator plugin to use extra vars, it will be possible to dynamically generate consistent hostnames based on variables provided at runtime. This ensures consistency across already existing virtual machines (that may be sourced from dynamic inventory plugin) and newly created virtual machines. This consistency is important for the use of group_vars and host_vars in the configuration phase.
Issue Type
Feature Idea
Component Name
plugins/inventory/generator.py
Additional Information
In inventory.yaml file:
plugin: ansible.builtin.generatorhosts:
# The `region` variable is provided at runtimename: "{{ region }}{{ machine_type }}"layers:
machine_type:
- web
- db
Summary
Use Cases
VM Creation
ansible.builtin.generator
plugin to use extra vars, it will be possible to dynamically generate consistent hostnames based on variables provided at runtime. This ensures consistency across already existing virtual machines (that may be sourced from dynamic inventory plugin) and newly created virtual machines. This consistency is important for the use ofgroup_vars
andhost_vars
in the configuration phase.Issue Type
Feature Idea
Component Name
plugins/inventory/generator.py
Additional Information
In
inventory.yaml
file:Running:
Should output:
Code of Conduct
The text was updated successfully, but these errors were encountered: