Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding fix for is instance profiles #85

Merged
merged 1 commit into from
Sep 9, 2022
Merged

Adding fix for is instance profiles #85

merged 1 commit into from
Sep 9, 2022

Conversation

greyhoundforty
Copy link
Contributor

@greyhoundforty greyhoundforty commented Feb 1, 2022

Prior to the proposed change, the code to list VPC instance profiles was failing due to a supposed Unsupported argument even though all three were expected.

Ansible Code used for testing

---
- name: List Instance Profiles
  hosts: localhost
  vars:
    region: "{{ lookup('env', 'IC_REGION') }}"
    resource_group: "{{ lookup('env', 'IC_RESOURCE_GROUP') }}"
  collections:
   - ibm.cloudcollection

  tasks:
    - ibm_is_instance_profiles_info:
        region: "{{ region }}"
      register: instance_profiles_list

    - debug:
        var: instance_profiles_list.resource.profiles | list

Produced the error:

TASK [ibm_is_instance_profiles_info] ***********************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "", "rc": 1, "resource": {"_name": "ansible_20220201-094045", "_type": "ibm_is_instance_profiles", "target": "ibm_is_instance_profiles.ansible_20220201-094045"}, "stderr": "\nError: Unsupported argument\n\n  on ibm_is_instance_profiles_ansible_20220201-094045.tf line 2, in data \"ibm_is_instance_profiles\" \"ansible_20220201-094045\":\n   2:   region = \"us-south\"\n\nAn argument named \"region\" is not expected here.\n\n\nError: Unsupported argument\n\n  on ibm_is_instance_profiles_ansible_20220201-094045.tf line 3, in data \"ibm_is_instance_profiles\" \"ansible_20220201-094045\":\n   3:   ibmcloud_api_key = \"********\"\n\nAn argument named \"ibmcloud_api_key\" is not expected here.\n\n\nError: Unsupported argument\n\n  on ibm_is_instance_profiles_ansible_20220201-094045.tf line 4, in data \"ibm_is_instance_profiles\" \"ansible_20220201-094045\":\n   4:   generation = 2\n\nAn argument named \"generation\" is not expected here.\n\n", "stderr_lines": ["", "Error: Unsupported argument", "", "  on ibm_is_instance_profiles_ansible_20220201-094045.tf line 2, in data \"ibm_is_instance_profiles\" \"ansible_20220201-094045\":", "   2:   region = \"us-south\"", "", "An argument named \"region\" is not expected here.", "", "", "Error: Unsupported argument", "", "  on ibm_is_instance_profiles_ansible_20220201-094045.tf line 3, in data \"ibm_is_instance_profiles\" \"ansible_20220201-094045\":", "   3:   ibmcloud_api_key = \"********\"", "", "An argument named \"ibmcloud_api_key\" is not expected here.", "", "", "Error: Unsupported argument", "", "  on ibm_is_instance_profiles_ansible_20220201-094045.tf line 4, in data \"ibm_is_instance_profiles\" \"ansible_20220201-094045\":", "   4:   generation = 2", "", "An argument named \"generation\" is not expected here.", ""], "stdout": "\nWarning: Argument is deprecated\n\nThe generation field is deprecated and will be removed after couple of\nreleases\n\n", "stdout_lines": ["", "Warning: Argument is deprecated", "", "The generation field is deprecated and will be removed after couple of", "releases", ""]}

@greyhoundforty
Copy link
Contributor Author

Fixes #82

@kavya498
Copy link
Contributor

@greyhoundforty , modules folder is auto-generated..
@Anil-CM , can you please help fix this issue..

@greyhoundforty
Copy link
Contributor Author

Ah, thanks for the update @kavya498 . Are there guides for generating these myself when I want to test something?

@jaywcarman
Copy link
Collaborator

@greyhoundforty The generator code is not open source. I just sent a PM with more info.

@jimccann-rh
Copy link

Curious is this going to get merged?? Seems to be a simple fix.

@hkantare hkantare merged commit 35affbe into IBM-Cloud:master Sep 9, 2022
@jimccann-rh
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants