Skip to content

Commit

Permalink
update minimum ansible-core to 2.14+
Browse files Browse the repository at this point in the history
linter

Signed-off-by: Guido Grazioli <[email protected]>
  • Loading branch information
guidograzioli committed Nov 14, 2023
1 parent 6a7192f commit 91e2a27
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repository hosts the `kubevirt.core` Ansible Collection, which provides vir
<!--start requires_ansible-->
## Ansible version compatibility

This collection has been tested against following Ansible versions: **>=2.9.10**.
This collection has been tested against following Ansible versions: **>=2.14.0**.
<!--end requires_ansible-->

## Included content
Expand Down
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
requires_ansible: '>=2.11.0' # Use '>= 2.9.10' instead, if needed
requires_ansible: '>=2.14.0'
26 changes: 15 additions & 11 deletions plugins/inventory/kubevirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,34 +131,38 @@
EXAMPLES = """
# Filename must end with kubevirt.[yml|yaml]
---
# Authenticate with token, and return all VirtualMachineInstances for all accessible namespaces
plugin: kubevirt.core.kubevirt
connections:
- host: https://192.168.64.4:8443
api_key: xxxxxxxxxxxxxxxx
validate_certs: false
- host: https://192.168.64.4:8443
api_key: xxxxxxxxxxxxxxxx
validate_certs: false
---
# Use default config (~/.kube/config) file and active context, and return VirtualMachineInstances
# from namespace testing with interfaces connected to network bridge-network
plugin: kubevirt.core.kubevirt
connections:
- namespaces:
- testing
network_name: bridge-network
- namespaces:
- testing
network_name: bridge-network
---
# Use default config (~/.kube/config) file and active context, and return VirtualMachineInstances
# from namespace testing with label app=test
plugin: kubevirt.core.kubevirt
connections:
- namespaces:
- testing
label_selector: app=test
- namespaces:
- testing
label_selector: app=test
---
# Use a custom config file, and a specific context.
plugin: kubevirt.core.kubevirt
connections:
- kubeconfig: /path/to/config
context: 'awx/192-168-64-4:8443/developer'
- kubeconfig: /path/to/config
context: 'awx/192-168-64-4:8443/developer'
"""

from dataclasses import dataclass
Expand Down
60 changes: 30 additions & 30 deletions plugins/modules/kubevirt_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,27 @@
domain:
devices:
interfaces:
- name: default
masquerade: {}
- name: bridge-network
bridge: {}
- name: default
masquerade: {}
- name: bridge-network
bridge: {}
networks:
- name: default
pod: {}
- name: bridge-network
multus:
networkName: kindexgw
- name: default
pod: {}
- name: bridge-network
multus:
networkName: kindexgw
volumes:
- containerDisk:
image: quay.io/containerdisks/fedora:latest
name: containerdisk
- cloudInitNoCloud:
userData: |-
#cloud-config
# The default username is: fedora
ssh_authorized_keys:
- ssh-ed25519 AAAA...
name: cloudinit
- containerDisk:
image: quay.io/containerdisks/fedora:latest
name: containerdisk
- cloudInitNoCloud:
userData: |-
#cloud-config
# The default username is: fedora
ssh_authorized_keys:
- ssh-ed25519 AAAA...
name: cloudinit
- name: Create a VirtualMachine with a DataVolume template
kubevirt.core.kubevirt_vm:
Expand All @@ -170,24 +170,24 @@
url: docker://quay.io/containerdisks/fedora:latest
storage:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 5Gi
spec:
domain:
devices: {}
volumes:
- dataVolume:
name: testdv
name: datavolume
- cloudInitNoCloud:
userData: |-
#cloud-config
# The default username is: fedora
ssh_authorized_keys:
- ssh-ed25519 AAAA...
name: cloudinit
- dataVolume:
name: testdv
name: datavolume
- cloudInitNoCloud:
userData: |-
#cloud-config
# The default username is: fedora
ssh_authorized_keys:
- ssh-ed25519 AAAA...
name: cloudinit
wait: yes
- name: Delete a VirtualMachine
Expand Down

0 comments on commit 91e2a27

Please sign in to comment.