From d7d70125a78277e868b479c8c827d371fbde35fd Mon Sep 17 00:00:00 2001 From: Felix Matouschek Date: Thu, 27 Jun 2024 15:44:21 +0200 Subject: [PATCH] chore: Add .vscode launch configs Add vscode launch configs to debug the modules and the inventory plugin. Signed-off-by: Felix Matouschek --- .gitignore | 5 --- .vscode/launch.json | 45 +++++++++++++++++++++++ .vscode/module_args/kubevirt_vm.json | 11 ++++++ .vscode/module_args/kubevirt_vm_info.json | 6 +++ 4 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/module_args/kubevirt_vm.json create mode 100644 .vscode/module_args/kubevirt_vm_info.json diff --git a/.gitignore b/.gitignore index 10d32f0..d006fb0 100644 --- a/.gitignore +++ b/.gitignore @@ -130,11 +130,6 @@ dmypy.json # Pyre type checker .pyre/ -# Allow specific vscode configuration -.vscode/* -!.vscode/extensions.json -!.vscode/settings.json - # Local files .idea/ bin/ diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..251af7d --- /dev/null +++ b/.vscode/launch.json @@ -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 + } + ] +} diff --git a/.vscode/module_args/kubevirt_vm.json b/.vscode/module_args/kubevirt_vm.json new file mode 100644 index 0000000..0db6bc9 --- /dev/null +++ b/.vscode/module_args/kubevirt_vm.json @@ -0,0 +1,11 @@ +{ + "ANSIBLE_MODULE_ARGS": { + "name": "testvm", + "namespace": "default", + "spec": { + "domain": { + "devices": {} + } + } + } +} diff --git a/.vscode/module_args/kubevirt_vm_info.json b/.vscode/module_args/kubevirt_vm_info.json new file mode 100644 index 0000000..755fae5 --- /dev/null +++ b/.vscode/module_args/kubevirt_vm_info.json @@ -0,0 +1,6 @@ +{ + "ANSIBLE_MODULE_ARGS": { + "name": "testvm", + "namespace": "default" + } +}