ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
814 stars 1.49k forks source link

onepassword_info crashes with error: "unknown flag: --output" #7321

Open sjf-control opened 11 months ago

sjf-control commented 11 months ago

Summary

When executing "community.general.onepassword_info" with a currently open 1password repository, it returns "mUnable to perform an initial sign in to 1Password. Please run 'op signin' or define credentials in 'auto_login'. See the module documentation for details."

When running the same module WITH auto_login values, it returns "Failed to perform initial sign in to 1Password: [ERROR] 2023/09/28 17:32:36 unknown flag: --output"

Issue Type

Bug Report

Component Name

module: onepassword_info

Ansible Version

$ ansible --version
  config file = /home/sjf/tick/ansible.cfg
  configured module search path = ['/home/sjf/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/sjf/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/sjf/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/sjf/.local/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
  jinja version = 3.0.3
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
Using /home/sjf/tick/ansible.cfg as config file

# /home/sjf/.local/lib/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 5.6.0  

# /home/sjf/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 7.4.0  

Configuration

    #  Failed to perform initial sign in to 1Password: 
    # [ERROR] 2023/09/27 13:16:18 unknown flag: --output
    - name: Try to reference a secret using onepassword
      community.general.onepassword_info:
        search_terms:
          - name: "ansible-ssh-password"
            field: "password"
            vault: "Ansible-Vaults"
        auto_login:
          master_password:  "<REDACTED>"
          secret_key:       "<REDACTED>"
          subdomain:        "<REDACTED>"
          username:         "<REDACTED>"
$ ansible-config dump --only-changed
Using /home/sjf/tick/ansible.cfg as config file
CALLBACKS_ENABLED(/home/sjf/tick/ansible.cfg) = ['ansible.posix.profile_tasks']
DEFAULT_HOST_LIST(/home/sjf/tick/ansible.cfg) = ['/home/sjf/tick/hosts.yaml']
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/sjf/tick/ansible.cfg) = False
DEFAULT_STDOUT_CALLBACK(/home/sjf/tick/ansible.cfg) = yaml
DEFAULT_VERBOSITY(/home/sjf/tick/ansible.cfg) = 1
HOST_KEY_CHECKING(/home/sjf/tick/ansible.cfg) = False
INTERPRETER_PYTHON(/home/sjf/tick/ansible.cfg) = auto
INVENTORY_ENABLED(/home/sjf/tick/ansible.cfg) = ['ini', 'yaml']
SHOW_CUSTOM_STATS(/home/sjf/tick/ansible.cfg) = False

OS / Environment

UTM Virtual Machine ARM64 (aarch64) QEMU 7.0 ARM Virtual Machine (alias of virtual-7.0) (virt)

Steps to Reproduce

execute the play below

    #  Failed to perform initial sign in to 1Password: 
    # [ERROR] 2023/09/27 13:16:18 unknown flag: --output
    - name: Try to reference a secret using onepassword
      community.general.onepassword_info:
        search_terms:
          - name: "ansible-ssh-password"
            field: "password"
            vault: "Ansible-Vaults"
        auto_login:
          master_password:  "<REDACTED>"
          secret_key:       "<REDACTED>"
          subdomain:        "<REDACTED>"
          username:         "<REDACTED>"

Result follows:

fatal: [rpi-tick2 -> localhost]: FAILED! => changed=false 
  msg: |-
    Failed to perform initial sign in to 1Password: [ERROR] 2023/09/28 17:57:36 unknown flag: --output
    Usage:  op signin [flags]

    Flags:
      -f, --force   Ignore warnings and print raw output from this command.
      -h, --help    Get help with signin.
          --raw     Only return the session token.

    To list the global flags available on every command, run  'op --help'.
...ignoring

Expected Results

Expected there to be no errors, and the requested 1password secret to be returned.

Actual Results

fatal: [rpi-tick2 -> localhost]: FAILED! => changed=false 
  msg: |-
    Failed to perform initial sign in to 1Password: [ERROR] 2023/09/28 18:05:44 unknown flag: --output
    Usage:  op signin [flags]

    Flags:
      -f, --force   Ignore warnings and print raw output from this command.
      -h, --help    Get help with signin.
          --raw     Only return the session token.

    To list the global flags available on every command, run  'op --help'.
...ignoring

Code of Conduct

ansibullbot commented 11 months ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 11 months ago

cc @Rylon click here for bot help

sjf-control commented 11 months ago

Any progress on this?

felixfontein commented 11 months ago

At least partially related to #5303.