ansible-collection-ibm
ansible-collection-ibm copied to clipboard
Error with is_default parameter in ibm_resource_group_info.py
Using ibm_resource_group_info with only "name" variable :
- name: Get information about Resource Group
ibm_resource_group_info:
name: "{{ resource_group }}"
#is_default: False
register: resource_group
trigger this error :
Error: \"is_default\": conflicts with name\n\n on ibm_resource_group_jregis-ansible-demo-rg.tf line 1, in data \"ibm_resource_group\" \"jregis-ansible-demo-rg\":\n 1: data ibm_resource_group \"jregis-ansible-demo-rg
We should use ibm_resource_group_info without is_default variable.
This error is due to the ~/.ansible/plugins/modules/ibm_resource_group_info.py module file where is_default is defined with default variable without required=True or False field.
To solve this error, modify the ~/.ansible/plugins/modules/ibm_resource_group_info.py :
diff --git a/plugins/modules/ibm_resource_group_info.py b/plugins/modules/ibm_resource_group_info.py
index 3282103..2054433 100644
--- a/plugins/modules/ibm_resource_group_info.py
+++ b/plugins/modules/ibm_resource_group_info.py
@@ -30,7 +30,6 @@ options:
- Default Resource group
required: False
type: bool
- default: False
ibmcloud_api_key:
description:
- The API Key used for authentification. This can also be provided
@@ -64,6 +63,7 @@ module_args = dict(
type='str'),
is_default=dict(
default=False,
+ required=False,
type='bool'),
ibmcloud_api_key=dict(
type='str',
This error could be solve with a PR.
@jamesregis fix is available in the latest release.