mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-03-26 19:03:16 +00:00
@@ -1,37 +1,11 @@
|
||||
# .ansible-lint
|
||||
exclude_paths:
|
||||
- .cache/
|
||||
- .github/
|
||||
- molecule/
|
||||
- .ansible-lint
|
||||
- .yamllint
|
||||
- meta/
|
||||
- playbooks/roles/
|
||||
- changelogs/changelog.yaml
|
||||
|
||||
enable_list:
|
||||
- fqcn-builtins # opt-in
|
||||
- no-log-password # opt-in
|
||||
- yaml
|
||||
|
||||
warn_list:
|
||||
- experimental
|
||||
- ignore-errors
|
||||
- no-handler
|
||||
- fqcn-builtins
|
||||
- no-log-password
|
||||
- no-empty-data-files
|
||||
- name[template]
|
||||
- fqcn[keyword]
|
||||
- schema[meta]
|
||||
- no-free-form
|
||||
- run-once[task]
|
||||
- var-naming[no-role-prefix]
|
||||
- galaxy[version-incorrect]
|
||||
- yaml[key-duplicates]
|
||||
|
||||
skip_list:
|
||||
- jinja[spacing]
|
||||
- yaml[truthy]
|
||||
|
||||
use_default_rules: true
|
||||
profile: production
|
||||
parseable: true
|
||||
|
||||
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
@@ -21,8 +21,19 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- run: |
|
||||
mkdir -p /home/runner/.kube/
|
||||
cp -rp ${GITHUB_WORKSPACE}/ansible_collections/kubevirt/core/tests/.kubeconfig /home/runner/.kube/config
|
||||
cat /home/runner/.kube/config
|
||||
cat <<- EOF > /home/runner/.kube/config
|
||||
apiVersion: v1
|
||||
kind: Config
|
||||
clusters:
|
||||
- cluster:
|
||||
server: http://localhost:12345
|
||||
name: default
|
||||
contexts:
|
||||
- context:
|
||||
cluster: default
|
||||
name: default
|
||||
current-context: default
|
||||
EOF
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
This repository hosts the `kubevirt.core` Ansible Collection, which provides virtual machine operations and inventory source for use with Ansible.
|
||||
|
||||
<!--start requires_ansible-->
|
||||
## Ansible version compatibility
|
||||
## Ansible and Python version compatibility
|
||||
|
||||
This collection has been tested against following Ansible versions: **>=2.14.0**.
|
||||
This collection has been tested against following Ansible versions **>=2.14.0** and the following Python versions **>=3.11.0,<3.12.0**.
|
||||
<!--end requires_ansible-->
|
||||
|
||||
## Included content
|
||||
|
||||
@@ -3,4 +3,4 @@ connections:
|
||||
- namespaces:
|
||||
- default
|
||||
network_name: bridge-network
|
||||
kube_secondary_dns: yes
|
||||
kube_secondary_dns: true
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
ssh_authorized_keys:
|
||||
- ssh-ed25519 AAAA...
|
||||
name: cloudinit
|
||||
wait: yes
|
||||
wait: true
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
state: present
|
||||
name: testvm
|
||||
namespace: default
|
||||
running: no
|
||||
running: false
|
||||
|
||||
@@ -37,4 +37,4 @@
|
||||
ssh_authorized_keys:
|
||||
- ssh-ed25519 AAAA...
|
||||
name: cloudinit
|
||||
wait: yes
|
||||
wait: true
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
name: testvm-with-dv
|
||||
namespace: default
|
||||
state: absent
|
||||
wait: yes
|
||||
wait: true
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
name: testvm
|
||||
namespace: default
|
||||
state: absent
|
||||
wait: yes
|
||||
wait: true
|
||||
|
||||
@@ -2,4 +2,4 @@ plugin: kubevirt.core.kubevirt
|
||||
connections:
|
||||
- namespaces:
|
||||
- default
|
||||
use_service: yes
|
||||
use_service: true
|
||||
|
||||
@@ -131,34 +131,32 @@ requirements:
|
||||
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
|
||||
- name: 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
|
||||
|
||||
# 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
|
||||
- name: Use default ~/.kube/config and return VirtualMachineInstances from namespace testing with interfaces connected to network bridge-network
|
||||
plugin: kubevirt.core.kubevirt
|
||||
connections:
|
||||
- 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
|
||||
- name: Use default ~/.kube/config and return VirtualMachineInstances from namespace testing with label app=test
|
||||
plugin: kubevirt.core.kubevirt
|
||||
connections:
|
||||
- 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'
|
||||
- name: 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'
|
||||
"""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
@@ -188,7 +188,7 @@ EXAMPLES = """
|
||||
ssh_authorized_keys:
|
||||
- ssh-ed25519 AAAA...
|
||||
name: cloudinit
|
||||
wait: yes
|
||||
wait: true
|
||||
|
||||
- name: Delete a VirtualMachine
|
||||
kubevirt.core.kubevirt_vm:
|
||||
|
||||
@@ -97,7 +97,7 @@ EXAMPLES = """
|
||||
kubevirt.core.kubevirt_vm_info:
|
||||
name: testvm
|
||||
namespace: default
|
||||
wait: yes
|
||||
wait: true
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
apiVersion: v1
|
||||
clusters:
|
||||
- cluster:
|
||||
insecure-skip-tls-verify: true
|
||||
server: http://localhost:12345
|
||||
name: development
|
||||
contexts:
|
||||
- context:
|
||||
cluster: development
|
||||
user: developer
|
||||
name: dev-frontend
|
||||
current-context: dev-frontend
|
||||
kind: Config
|
||||
preferences: {}
|
||||
users:
|
||||
- name: developer
|
||||
user:
|
||||
token: ZDNffLzSlp8aSS0fht_tRnPMTOjxqgJGCyi_iy0ecUw
|
||||
2
tests/config.yaml
Normal file
2
tests/config.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
modules:
|
||||
python_requires: ">=3.11.0,<3.12.0"
|
||||
@@ -10,7 +10,7 @@
|
||||
namespace: default
|
||||
labels:
|
||||
app: test
|
||||
wait: yes
|
||||
wait: true
|
||||
wait_timeout: 600
|
||||
spec:
|
||||
domain:
|
||||
@@ -41,7 +41,7 @@
|
||||
namespace: default
|
||||
labels:
|
||||
foo: bar
|
||||
wait: yes
|
||||
wait: true
|
||||
wait_timeout: 600
|
||||
spec:
|
||||
domain:
|
||||
|
||||
@@ -2,4 +2,4 @@ plugin: kubevirt.core.kubevirt
|
||||
connections:
|
||||
- namespaces:
|
||||
- default
|
||||
create_groups: yes
|
||||
create_groups: true
|
||||
|
||||
@@ -2,5 +2,5 @@ plugin: kubevirt.core.kubevirt
|
||||
connections:
|
||||
- namespaces:
|
||||
- default
|
||||
create_groups: yes
|
||||
create_groups: true
|
||||
label_selector: app=test
|
||||
|
||||
@@ -2,5 +2,5 @@ plugin: kubevirt.core.kubevirt
|
||||
connections:
|
||||
- namespaces:
|
||||
- default
|
||||
create_groups: yes
|
||||
create_groups: true
|
||||
network_name: bridge-network
|
||||
|
||||
Reference in New Issue
Block a user