#402 add support for TEST_HOSTALIASES
Merged by astepano. Opened by rmeggins.
rmeggins/standard-test-roles hostalias-arg  into  master

Download 402.patch

By default, standard-inventory-qcow2 will use the full path and filename of
the image.qcow2 file as the host key in the inventory. If you would rather
provide a different name for the host that corresponds to the file, you can use
either the --hostalias cli flag or the TEST_HOSTALIASES environment
variable. If you want to use the basename of the path as the alias for all images,
use the --use-basename cli flag.

@nhosoi @spetros

@nhosoi @spetros

What happens if I set TEST_HOSTALIASES="sut1 BASENAME"? :) And if I have 5 TEST_SUBJECTS with TEST_HOSTALIASES="sut1 BASENAME", just the first one has "sut1" and the other 4 would have its own test_subject file name?

Never mind. BASENAME has to be a string and one item. I'm happy with it.

I am not sure about this, it looks like the same host-alias under index 0 can be used a few times.

1 new commit added

  • add --use-basename parameter

I am not sure about this, it looks like the same host-alias under index 0 can be used a few times.

ok - in order to make this clearer and simpler
* hostaliases must be exactly the same length as subjects
* there is a new --use-basename if you want to use the basename for all subjects/images

Ack to merge, looks reasonable.
Please write comment when the PR is ready to be merged.

@nhosoi ok?

@nhosoi ok?

Yes, it's clearer now. Thanks, @rmeggins!
lgtm

the PR is ready to be merged

Hello, sorry, I merged https://pagure.io/standard-test-roles/pull-request/403
Now this PR cannot be merged due conflicts.
Please fix.

Question: do you want to have new build of standard-test-roles with these merged PR?

rebased onto c4d79725d4bd2ef557085829c79dfd22fb4129a1

Hello, sorry, I merged https://pagure.io/standard-test-roles/pull-request/403
Now this PR cannot be merged due conflicts.
Please fix.

Done.

Question: do you want to have new build of standard-test-roles with these merged PR?

When are you planning to do another build? What is your typical build/release cadence? We don't need this in a build/release urgently - we can continue to grab the file from pagure for the short term.

@rmeggins which environment are you looking primarly? Fedora CI, RHEL CI, BaseOS CI? Something else?

Commit b885eb06 fixes this pull-request

Pull-Request has been merged by astepano

Pull-Request has been merged by astepano

@rmeggins which environment are you looking primarly? Fedora CI, RHEL CI, BaseOS CI? Something else?

The environment is the current downstream testing using qcow2 images, and upstream developer use.

This feature is primarily to support ansible-navigator, which will eventually replace ansible and ansible-playbook command line tools. ansible-navigator currently creates directories for logs, caches, etc. which have the hostname in the path name. This doesn't work if the hostname is the absolute path to a qcow2 image file. So we need this feature in order to use an alias/basename instead of the absolute path.

Metadata