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

Cannot list Instance Profiles in VPC #82

Open
greyhoundforty opened this issue Jan 31, 2022 · 1 comment
Open

Cannot list Instance Profiles in VPC #82

greyhoundforty opened this issue Jan 31, 2022 · 1 comment

Comments

@greyhoundforty
Copy link
Contributor

I am running in to an issue when trying to list out the available Instance profiles using the Ansible Collection:

Ansible Playbook

---
- 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:
      register: instance_profiles_list

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

Error

TASK [ibm_is_instance_profiles_info] ****************************************************************************************************************************************
task path: /Users/ryan/Desktop/CurrentProjects/IBM-Cloud-Ansible-/list-profiles.yml:11
fatal: [localhost]: FAILED! => {"changed": false, "msg": "", "rc": 1, "resource": {"_name": "ansible_20220131-125040", "_type": "ibm_is_instance_profiles", "target": "ibm_is_instance_profiles.ansible_20220131-125040"}, "stderr": "\nError: Unsupported argument\n\n  on ibm_is_instance_profiles_ansible_20220131-125040.tf line 2, in data \"ibm_is_instance_profiles\" \"ansible_20220131-125040\":\n   2:   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_20220131-125040.tf line 3, in data \"ibm_is_instance_profiles\" \"ansible_20220131-125040\":\n   3:   generation = 2\n\nAn argument named \"generation\" is not expected here.\n\n\nError: Unsupported argument\n\n  on ibm_is_instance_profiles_ansible_20220131-125040.tf line 4, in data \"ibm_is_instance_profiles\" \"ansible_20220131-125040\":\n   4:   region = \"us-south\"\n\nAn argument named \"region\" is not expected here.\n\n", "stderr_lines": ["", "Error: Unsupported argument", "", "  on ibm_is_instance_profiles_ansible_20220131-125040.tf line 2, in data \"ibm_is_instance_profiles\" \"ansible_20220131-125040\":", "   2:   ibmcloud_api_key = \"********\"", "", "An argument named \"ibmcloud_api_key\" is not expected here.", "", "", "Error: Unsupported argument", "", "  on ibm_is_instance_profiles_ansible_20220131-125040.tf line 3, in data \"ibm_is_instance_profiles\" \"ansible_20220131-125040\":", "   3:   generation = 2", "", "An argument named \"generation\" is not expected here.", "", "", "Error: Unsupported argument", "", "  on ibm_is_instance_profiles_ansible_20220131-125040.tf line 4, in data \"ibm_is_instance_profiles\" \"ansible_20220131-125040\":", "   4:   region = \"us-south\"", "", "An argument named \"region\" 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", ""]}

System Info

$  ansible --version
ansible [core 2.12.1]
  config file = /Users/ryan/.ansible.cfg
  configured module search path = ['/Users/ryan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/5.2.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/ryan/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.10.1 (main, Dec  6 2021, 22:18:13) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.3
  libyaml = True
@greyhoundforty
Copy link
Contributor Author

greyhoundforty commented Feb 1, 2022

I was able to resolve this by updating the accompanying python file (plugins/modules/ibm_is_instance_profiles_info.py) and adding in the name and visibility options to TL_ALL_PARAMETERS

TL_ALL_PARAMETERS = [
]

To

TL_ALL_PARAMETERS = [
    'name',
    'visibility',
]

I have also opened a pull request for this issue.

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

No branches or pull requests

1 participant