volanja / ansible_spec

It's ruby gem that connect Ansible & Serverspec for Test Driven Server Configuration(or TDD).
MIT License
229 stars 57 forks source link

Incorporate group parent child relationships into variable assignment hierarchy #118

Closed rbramwell closed 6 years ago

rbramwell commented 6 years ago

TL;DR:

Makes variables that are set at the parent group level available to child groups.

Overview:

The current code base does away with [parentgroup:children] groups in favour of converting the parent group into a group at the same level as its children. However, this dismisses the fact that parent-child relationships add a level of precedence to variable assignments for groups. This PR adds this logic to better align ansible_spec variable assignments with how this is done in Ansible.

Example:

hosts file:

screenshot at 2018-08-22 05-25-50

Makes variables set in ./group_vars/parentgroup/vars (or any files in the dir) available to hosts in the [group1] and [group2] groups.

volanja commented 6 years ago

I modified code (e9395816a6dcb994c716c3e8df191f3392284ef8). Thank you for your contribution!

rbramwell commented 6 years ago

Glad to have contributed!