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

cyberark_account module throws error for invalid api_base_url when pulled from registered session #31

Open
1 of 3 tasks
jamesmarshall24 opened this issue Jun 16, 2021 · 0 comments

Comments

@jamesmarshall24
Copy link
Contributor

jamesmarshall24 commented Jun 16, 2021

Summary

Attempting to use collection version 1.0.7 with cyberark_account after a successful cyberark_authentication results in an error with api_base_url

Steps to Reproduce

  1. Install latest collection: ansible-galaxy collection install cyberark.pas:1.0.7
  2. Write a playbook with contents similar to the following:
    - name: Logon to CyberArk Vault using PAS Web Services SDK
      cyberark.pas.cyberark_authentication:
        api_base_url: "http://components.cyberark.local"
        validate_certs: no
        username: "bizdev"
        password: "Cyberark1"

    - name: Creating an Account using the PAS WebServices SDK
      cyberark.pas.cyberark_account:
        logging_level: DEBUG
        identified_by: "address,username"
        safe: "Test"
        address: "cyberark.local"
        username: "administrator-x"
        platform_id: WinServerLocal
        secret: "@N&Ibl3!"
        platform_account_properties:
            LogonDomain: "cyberark"
            OwnerName: "ansible_user"
        secret_management:
            automatic_management_enabled: true
        state: present
        cyberark_session: "{{ cyberark_session }}"
      register: cyberarkaction
  1. Run the playbook

Expected Results

Account created

Actual Results

Line: cyberark_account.py#L1075 fails with key error

Traceback (most recent call last):
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1623780866.6344018-975949-190468678997879/AnsiballZ_cyberark_account.py", line 247, in <module>
    _ansiballz_main()
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1623780866.6344018-975949-190468678997879/AnsiballZ_cyberark_account.py", line 237, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1623780866.6344018-975949-190468678997879/AnsiballZ_cyberark_account.py", line 108, in invoke_module
    runpy.run_module(mod_name='ansible_collections.cyberark.pas.plugins.modules.cyberark_account', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_cyberark.pas.cyberark_account_payload_tjanvl99/ansible_cyberark.pas.cyberark_account_payload.zip/ansible_collections/cyberark/pas/plugins/modules/cyberark_account.py", line 1300, in <module>
  File "/tmp/ansible_cyberark.pas.cyberark_account_payload_tjanvl99/ansible_cyberark.pas.cyberark_account_payload.zip/ansible_collections/cyberark/pas/plugins/modules/cyberark_account.py", line 1258, in main
  File "/tmp/ansible_cyberark.pas.cyberark_account_payload_tjanvl99/ansible_cyberark.pas.cyberark_account_payload.zip/ansible_collections/cyberark/pas/plugins/modules/cyberark_account.py", line 1075, in get_account
KeyError: 'api_base_url'

Reproducible

  • Always
  • Sometimes
  • Non-Reproducible

Version/Tag number

1.0.7

Environment setup

  • RHEL8
  • python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants