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
fact "ansible_virtualization_type" incorrect for alpine container on GitHub runner "ubuntu-latest" #66304
Comments
Files identified in the description: If these files are inaccurate, please update the |
So the issue here seems to be that we detect ONE of the virtualization types in use, in this case Azure exposes 'VirtualPC'. This is 'correct' but not 'fully correct', for a long time we have had the issue that most hosts now run under multiple virtualization types and can be host to mulitple types. For example, my workstation does qemu/virtualbox/lxd/docker/xen hosting, but only appears as one of those to facts. So I'm going to keep this issue open but hijack it to create new 'virtualization facts list' vs the current single value, which only shows ONE of the types of virtualization you are in. |
Relates to ansible/ansible#66304
Files identified in the description: If these files are incorrect, please update the |
Change: - Allow systems to declare multiple virt techs. For example if a system is both a docker container, but virtualized on KVM, show both. If a system is set up to run virtualbox and KVM VMs, show both. - This is done by introducing new facts keys: - virtualization_tech_guest - virtualization_tech_host - Backwards compatibility is preserved by keeping track of the previous return-points and refusing to update those keys after we would have returned, but now returning them at the end, so that the new keys can accumulate their data. Test Plan: - Local - CI Tickets: - Refs ansible#66304 - Refs ansible#17151 - Refs ansible#17058 - Probably others Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - Allow systems to declare multiple virt techs. For example if a system is both a docker container, but virtualized on KVM, show both. If a system is set up to run virtualbox and KVM VMs, show both. - This is done by introducing new facts keys: - virtualization_tech_guest - virtualization_tech_host - Backwards compatibility is preserved by keeping track of the previous return-points and refusing to update those keys after we would have returned, but now returning them at the end, so that the new keys can accumulate their data. Test Plan: - Local - CI Tickets: - Refs ansible#66304 - Refs ansible#17151 - Refs ansible#17058 - Probably others Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - Allow systems to declare multiple virt techs. For example if a system is both a docker container, but virtualized on KVM, show both. If a system is set up to run virtualbox and KVM VMs, show both. - This is done by introducing new facts keys: - virtualization_tech_guest - virtualization_tech_host - Backwards compatibility is preserved by keeping track of the previous return-points and refusing to update those keys after we would have returned, but now returning them at the end, so that the new keys can accumulate their data. Test Plan: - Local - CI Tickets: - Refs ansible#66304 - Refs ansible#17151 - Refs ansible#17058 - Probably others Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - Allow systems to declare multiple virt techs. For example if a system is both a docker container, but virtualized on KVM, show both. If a system is set up to run virtualbox and KVM VMs, show both. - This is done by introducing new facts keys: - virtualization_tech_guest - virtualization_tech_host - Backwards compatibility is preserved by keeping track of the previous return-points and refusing to update those keys after we would have returned, but now returning them at the end, so that the new keys can accumulate their data. Test Plan: - Local - CI Tickets: - Refs #66304 - Refs #17151 - Refs #17058 - Probably others Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - Allow systems to declare multiple virt techs. For example if a system is both a docker container, but virtualized on KVM, show both. If a system is set up to run virtualbox and KVM VMs, show both. - This is done by introducing new facts keys: - virtualization_tech_guest - virtualization_tech_host - Backwards compatibility is preserved by keeping track of the previous return-points and refusing to update those keys after we would have returned, but now returning them at the end, so that the new keys can accumulate their data. Test Plan: - Local - CI Tickets: - Refs ansible#66304 - Refs ansible#17151 - Refs ansible#17058 - Probably others Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - Allow systems to declare multiple virt techs. For example if a system is both a docker container, but virtualized on KVM, show both. If a system is set up to run virtualbox and KVM VMs, show both. - This is done by introducing new facts keys: - virtualization_tech_guest - virtualization_tech_host - Backwards compatibility is preserved by keeping track of the previous return-points and refusing to update those keys after we would have returned, but now returning them at the end, so that the new keys can accumulate their data. Test Plan: - Local - CI Tickets: - Refs ansible#66304 - Refs ansible#17151 - Refs ansible#17058 - Probably others Signed-off-by: Rick Elrod <rick@elrod.me> (cherry picked from commit 4e55b93) Backporting enhanced virtualization/container reporting.
Change: - Allow systems to declare multiple virt techs. For example if a system is both a docker container, but virtualized on KVM, show both. If a system is set up to run virtualbox and KVM VMs, show both. - This is done by introducing new facts keys: - virtualization_tech_guest - virtualization_tech_host - Backwards compatibility is preserved by keeping track of the previous return-points and refusing to update those keys after we would have returned, but now returning them at the end, so that the new keys can accumulate their data. Test Plan: - Local - CI Tickets: - Refs ansible#66304 - Refs ansible#17151 - Refs ansible#17058 - Probably others Signed-off-by: Rick Elrod <rick@elrod.me> (cherry picked from commit 4e55b93) Backporting enhanced virtualization/container reporting.
…ble#70832) Change: - Allow systems to declare multiple virt techs. For example if a system is both a docker container, but virtualized on KVM, show both. If a system is set up to run virtualbox and KVM VMs, show both. - This is done by introducing new facts keys: - virtualization_tech_guest - virtualization_tech_host - Backwards compatibility is preserved by keeping track of the previous return-points and refusing to update those keys after we would have returned, but now returning them at the end, so that the new keys can accumulate their data. Test Plan: - Local - CI Tickets: - Refs ansible#66304 - Refs ansible#17151 - Refs ansible#17058 - Probably others Signed-off-by: Rick Elrod <rick@elrod.me>. (cherry picked from commit 4e55b93) Co-authored-by: Rick Elrod <rick@elrod.me>
…le#70832) Change: - Allow systems to declare multiple virt techs. For example if a system is both a docker container, but virtualized on KVM, show both. If a system is set up to run virtualbox and KVM VMs, show both. - This is done by introducing new facts keys: - virtualization_tech_guest - virtualization_tech_host - Backwards compatibility is preserved by keeping track of the previous return-points and refusing to update those keys after we would have returned, but now returning them at the end, so that the new keys can accumulate their data. Test Plan: - Local - CI Tickets: - Refs ansible#66304 - Refs ansible#17151 - Refs ansible#17058 - Probably others Signed-off-by: Rick Elrod <rick@elrod.me>. (cherry picked from commit 4e55b93) Co-authored-by: Rick Elrod <rick@elrod.me>
Change: - containerd is now recognized as container tech Test Plan: - N/A :( Tickets: - Fixes ansible#66304 because this is what docker containers show up as in Github Actions. Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - containerd is now recognized as container tech Test Plan: - N/A :( Tickets: - Fixes ansible#66304 because this is what docker containers show up as in Github Actions. Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - containerd is now recognized as container tech Test Plan: - Tested with github actions with Docker, and got expected result. Tickets: - Fixes ansible#66304 because this is what docker containers show up as in Github Actions. Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - containerd is now recognized as container tech Test Plan: - Tested with github actions with Docker, and got expected result. Tickets: - Fixes ansible#66304 because this is what docker containers show up as in Github Actions. Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - containerd is now recognized as container tech Test Plan: - Tested with Docker inside Github Actions in a private repo: "ansible_virtualization_role": "guest", "ansible_virtualization_tech_guest": [ "containerd", "container", "VirtualPC" ], "ansible_virtualization_tech_host": [], "ansible_virtualization_type": "containerd", Tickets: - Fixes ansible#66304 because this is what docker containers show up as in Github Actions. Signed-off-by: Rick Elrod <rick@elrod.me>
Change: - containerd is now recognized as container tech Test Plan: - Tested with Docker inside Github Actions in a private repo: "ansible_virtualization_role": "guest", "ansible_virtualization_tech_guest": [ "containerd", "container", "VirtualPC" ], "ansible_virtualization_tech_host": [], "ansible_virtualization_type": "containerd", Tickets: - Fixes #66304 because this is what docker containers show up as in Github Actions. Signed-off-by: Rick Elrod <rick@elrod.me>
SUMMARY
GitHub offers a shared runner of the type "ubuntu-latest". When molecule spins up an Alpine container,
setup
returns "VirtualPC" foransible_virtualization_type
.ISSUE TYPE
COMPONENT NAME
setup
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
GitHub runners are Ubuntu machines, hosted on Azure
STEPS TO REPRODUCE
This can only be reproduced in CI, as I don't know any other way to start this type of instance manually.
I use this code to check if the play is running in a container:
EXPECTED RESULTS
I was expecting
ansible_virtualization_type
to returndocker
.ACTUAL RESULTS
The fact
ansible_virtualization_type
is set toVirtualPC
Likely this code is related: https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/virtual/linux.py#L134
The text was updated successfully, but these errors were encountered: