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

Isolating changes to a single hosts.ini file for a more maintainable solution. #6

Closed
wants to merge 0 commits into from

Conversation

RanchoHam
Copy link
Sponsor

Move changes related to a particular physical server into one place, i.e. the hosts.ini file.
Provide for specifying a different ansible user/group.

I am working with two clusters: 1) is a Turing Pi V2, and 2) is a Dramble with 5 RPi4's (I had an 8 port PoE switch). I want to maintain them with a single directory/code base; but one has dual drives on node3 amenable to zfs and the other has single drives on all nodes amenable to the filesystem storage model. They also have different IP address ranges. Therefore, I envision using two separate hosts.ini files each targeting one cluster; and invoking the like this:
ansible-playbook -i clusterX_hosts.ini main.yml
or
ansible-playbook -i clusterY_hosts.ini main.yml

@geerlingguy
Copy link
Owner

I could go either way on this, but the main fix I think I would like to adopt is the group change from hardcoded pi to {{ ansible_user }}.

Regarding inventory, inventory vars should override vars inside the playbook still—was that not the case if you defined them inventory-level even using the playbook as-is?

@RanchoHam
Copy link
Sponsor Author

I was not sure about the inventory vars overriding the config.yml, so I just wrote them out. I'll go back, try it, and let you know. I'm a complete nubie to collaborating over github, so I am a bit unsure of how to get any changes into the pull request. But we will muddle through.

@RanchoHam
Copy link
Sponsor Author

OK, I owed you an answer regarding inventory overriding vars inside the playbook. It appears that the inventory does override the playbook vars.

I am fine with just fixing the group change from hardcoded pi to {{ ansible_user }}. Let's go with just that change.

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.

None yet

2 participants