Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Allow setting instance host name #161

Merged
merged 3 commits into from
Aug 7, 2022
Merged

Conversation

apatard
Copy link
Member

@apatard apatard commented Jan 5, 2022

It may be useful to be able to set the instance hostname/FQDN or to prevent
vagrant to set the hostname, so add support for that.

The default behaviour is unchanged: the host name is set to the instance
name.

Fixes: #157
Signed-off-by: Arnaud Patard apatard@hupstream.com

@apatard apatard requested a review from ssbarnea as a code owner January 5, 2022 10:37
@apatard apatard added enhancement New feature or request feature labels Jan 5, 2022
@apatard
Copy link
Member Author

apatard commented Jan 5, 2022

Should have tested on bionic too... current CI setup will install vagrant 2.2.9 on bionic which doesn't correctly set the hostname on alpine boxes (fixed on 2.2.10)... will add one more commit to bump vagrant version. I guess that later vagrant installation will possibly need to be revisited since there are repos for deb and rpm which may be better than download packages manually...

@ssbarnea ssbarnea changed the title molecule_vagrant/modules/vagrant.py: Allow setting instance host name Allow setting instance host name Jan 5, 2022
It may be useful to be able to set the instance hostname/FQDN or to prevent
vagrant to set the hostname, so add support for that.

The default behaviour is unchanged: the host name is set to the instance
name.

Fixes: ansible-community#157
Signed-off-by: Arnaud Patard <apatard@hupstream.com>
…ge version

This commit is solving two issues:
- Vagrant 2.2.10 is needed at least, otherwise it will fail to properly set
  the hostname. 2.2.10 is already installed with manual rpm installation but
  not for bionic
- Vagrant version for manually installed package is not the same for rpm and
  bionic, so rely on a variable to ensure consistency.

Signed-off-by: Arnaud Patard <apatard@hupstream.com>
apatard added a commit to apatard/molecule-vagrant that referenced this pull request Apr 15, 2022
The current code is reduced to a big example but doesn't exactly
explains how to configure things. This results in bug reports.
So try to fix it.

[ Note: it's already documenting hostname option from PR ansible-community#161 so
this PR has to be merged after PR ansible-community#161 ]

Signed-off-by: Arnaud Patard <apatard@hupstream.com>
@ssbarnea ssbarnea enabled auto-merge (squash) August 7, 2022 11:50
@ssbarnea ssbarnea merged commit 5d432b8 into ansible-community:main Aug 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create boolean option for vm.hostname
2 participants