IBM / cloud-pak-deployer

Configuration-based installation of OpenShift and Cloud Pak for Data/Integration/Watson AIOps on various private and public cloud infrastructure providers. Deployment attempts to achieve the end-state defined in the configuration. If something fails along the way, you only need to restart the process to continue the deployment.
https://ibm.github.io/cloud-pak-deployer/
Apache License 2.0
136 stars 67 forks source link

az cli install fails #694

Closed fketelaars closed 5 months ago

fketelaars commented 5 months ago

Describe the bug When running deployer for Azure, the following error is thrown:

TASK [azure-download-az : Get az cli version] **********************************
Wednesday 17 April 2024  07:02:01 +0000 (0:00:59.195)       0:01:18.305 *******
fatal: [localhost]: FAILED! => changed=true
  cmd: |-
    az version
  delta: '0:00:05.702772'
  end: '2024-04-17 07:02:07.816449'
  msg: non-zero return code
  rc: 1
  start: '2024-04-17 07:02:02.113677'
  stderr: |-
    ERROR: The command failed with an unexpected error. Here is the traceback:
    ERROR: argument _command_package: conflicting subparser: version
    Traceback (most recent call last):
      File "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
        cmd_result = self.invocation.execute(args)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 565, in execute
        self.parser.load_command_table(self.commands_loader)
      File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/parser.py", line 100, in load_command_table
        command_parser = subparser.add_parser(command_verb,
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/python3.11/argparse.py", line 1192, in add_parser
        raise ArgumentError(self, _('conflicting subparser: %s') % name)
    argparse.ArgumentError: argument _command_package: conflicting subparser: version
    To open an issue, please run: 'az feedback'
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

Solution With the latest (UBI-9) based image of olm-utils-v2, we need to use the following steps to install az cli:

rpm --import https://packages.microsoft.com/keys/microsoft.asc
dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm
dnf install azure-cli -y