Exceptions for Docker/Podman #1

Closed
opened 2023-11-26 12:44:27 -05:00 by chris · 3 comments
Owner

On dev box, ansible_virtualization_type appears to return as container. On Drone, ansible_virtualization_type, returns as either docker or podman.

We've tried doing an or, but for some reason it is not working so we can't make use of if ansible_virtualization_type != 'docker' or if ansible_virtualization_type != 'podman'. We need to explore why.

On dev box, `ansible_virtualization_type` appears to return as `container`. On Drone, `ansible_virtualization_type`, returns as either `docker` or `podman`. We've tried doing an or, but for some reason it is not working so we can't make use of `if ansible_virtualization_type != 'docker' or if ansible_virtualization_type != 'podman'`. We need to explore why.
Author
Owner

Development Box Results

TASK [Debug ansible_virtualization_type] **************************************
ok: [127.0.0.1] => {
    "ansible_virtualization_type": "container"
}

Drone CI Results:

TASK [Debug ansible_virtualization_type] ***************************************

ok: [127.0.0.1] => {

    "ansible_virtualization_type": "docker"

}
### Development Box Results ``` TASK [Debug ansible_virtualization_type] ************************************** ok: [127.0.0.1] => { "ansible_virtualization_type": "container" } ``` ### Drone CI Results: ``` TASK [Debug ansible_virtualization_type] *************************************** ok: [127.0.0.1] => { "ansible_virtualization_type": "docker" } ```
Author
Owner

Testing potential fix:

      when:
        - ansible_virtualization_type | select('match', '(?:podman|docker|container)')
### Testing potential fix: ``` when: - ansible_virtualization_type | select('match', '(?:podman|docker|container)') ```
chris referenced this issue from a commit 2023-11-26 19:20:31 -05:00
Author
Owner

Fix looks good. Closing issue.

Fix looks good. Closing issue.
chris closed this issue 2023-11-26 19:22:44 -05:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ansible_plays/gitea#1
No description provided.