chore: Add .vscode launch configs

Add vscode launch configs to debug the modules and the inventory plugin.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
Felix Matouschek
2024-06-27 15:44:21 +02:00
parent 35b2d3ef6b
commit d7d70125a7
4 changed files with 62 additions and 5 deletions

5
.gitignore vendored
View File

@@ -130,11 +130,6 @@ dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
# Allow specific vscode configuration
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
# Local files # Local files
.idea/ .idea/
bin/ bin/

45
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,45 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug: Ansible Module",
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}",
"module": "plugins.modules.${fileBasenameNoExtension}",
"console": "internalConsole",
"args": [
"${workspaceFolder}/.vscode/module_args/${fileBasenameNoExtension}.json"
],
"justMyCode": false
},
{
"name": "Debug: Ansible Inventory",
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}",
"module": "ansible.cli.inventory",
"console": "internalConsole",
"args": [
"--inventory",
"${workspaceFolder}/examples/default.kubevirt.yml",
"--list"
],
"justMyCode": false
},
{
"name": "Debug: Unit Tests",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": [
"debug-test"
],
"console": "internalConsole",
"justMyCode": false
}
]
}

11
.vscode/module_args/kubevirt_vm.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"ANSIBLE_MODULE_ARGS": {
"name": "testvm",
"namespace": "default",
"spec": {
"domain": {
"devices": {}
}
}
}
}

View File

@@ -0,0 +1,6 @@
{
"ANSIBLE_MODULE_ARGS": {
"name": "testvm",
"namespace": "default"
}
}