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

[ibm-telco] : /opt/assisted-service-ztp/default_ocp_versions.json: No such file or directory #154

Open
maheshd2 opened this issue Aug 18, 2021 · 1 comment

Comments

@maheshd2
Copy link

maheshd2 commented Aug 18, 2021

As we found some issue with using older version of AI stable.17.03.2021-13.18 / v1.0.18.3, we tried installing latest AI (prepare-environment role). But stable/4.7 branch code fails because it could not find the file /opt/assisted-service-ztp/default_ocp_versions.json. Also checked in the assisted-service git repo and saw this file is removed.

Then we tried deploying the latest AI using the ZTP main branch (prepare-environment role), it again failed because of same issue ( it could not find the file `/opt/assisted-service-ztp/default_ocp_versions.json).

The main branch code also has a reference to the role (install-assisted-installer) which does not exists in the main branch.
As a work around we are using sonofspike onprem AI playbooks for bringing up latest AI.

- name: Read json with image versions
  shell: cat "/opt/assisted-service-ztp/default_ocp_versions.json"
  register: json_content

- name: Query for the right ISO according to the version
  vars:
    jsondata: "{{ json_content.stdout | from_json }}"
    query_version: "\"{{ cluster_version }}\".rhcos_image"
  set_fact:
    rhcos_base_iso: "{{ jsondata | json_query(query_version) }}"

- name: install assisted installer
  include_role:
    name: "{{ playbook_dir }}/../common-roles/install-assisted-installer"
  vars:
    onprem_vars:
      - - "SUPPORT_L2=false"
        - "SERVICE_BASE_URL={{ ai_url }}"
        - "HW_VALIDATOR_MIN_DISK_SIZE_GIB=50"
        - "PUBLIC_CONTAINER_REGISTRIES=quay.io,registry.svc.ci.openshift.org"
        - "RHCOS_BASE_ISO={{ rhcos_base_iso }}"
        - "AUTH_TYPE=none"

Error:

TASK [prepare-environment : Read json with image versions] ***********************************************************************************************
task path: /root/mdn_ztp_and_sos_master_test/ztp-cluster-deploy/ai-deploy-cluster-remoteworker/roles/prepare-environment/tasks/main.yml:20
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1629253151.0912158-2434755-173838468492636 `" && echo ansible-tmp-1629253151.0912158-2434755-173838468492636="` echo /root/.ansible/tmp/ansible-tmp-1629253151.0912158-2434755-173838468492636 `" ) && sleep 0'
Using module file /usr/lib/python3.6/site-packages/ansible/modules/commands/command.py
<localhost> PUT /root/.ansible/tmp/ansible-local-2434505eby86p1h/tmp_s9nk4np TO /root/.ansible/tmp/ansible-tmp-1629253151.0912158-2434755-173838468492636/AnsiballZ_command.py
<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1629253151.0912158-2434755-173838468492636/ /root/.ansible/tmp/ansible-tmp-1629253151.0912158-2434755-173838468492636/AnsiballZ_command.py && sleep 0'
<localhost> EXEC /bin/sh -c 'PATH=/usr/bin/:/usr/local/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/go/bin:/root/bin /usr/libexec/platform-python /root/.ansible/tmp/ansible-tmp-1629253151.0912158-2434755-173838468492636/AnsiballZ_command.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1629253151.0912158-2434755-173838468492636/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": "cat \"/opt/assisted-service-ztp/default_ocp_versions.json\"",
    "delta": "0:00:00.005958",
    "end": "2021-08-18 07:49:11.338455",
    "invocation": {
        "module_args": {
            "_raw_params": "cat \"/opt/assisted-service-ztp/default_ocp_versions.json\"",
            "_uses_shell": true,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2021-08-18 07:49:11.332497",
    "stderr": "cat: /opt/assisted-service-ztp/default_ocp_versions.json: No such file or directory",
    "stderr_lines": [
        "cat: /opt/assisted-service-ztp/default_ocp_versions.json: No such file or directory"
    ],
    "stdout": "",
    "stdout_lines": []
}
@yrobla
Copy link
Contributor

yrobla commented Sep 28, 2021

Assisted installer also has evolved,the workflow changed to integrate with ACM. In order to continue using the older workflow, you need to pin the AI images to the good known versions that were in stable branch.

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

2 participants