ansible / instruqt

Self-paced instruqt Training material
72 stars 61 forks source link

Issue with Intro to AAP config as code slug ID: hub_exercise2 #549

Closed laurent-indermuehle closed 7 months ago

laurent-indermuehle commented 10 months ago

I launched lab 2, and the Task 5 fails to pull images (2nd command). It tries to pull the EE from the private AH, but there is no images yet for "config_as_code". Do I need to re-run lab 1 and quickly lab 2 after that? Or are they isolated?

I noticed that the image is pushed to the controller instead of the private AH in build_ee.yml of lab2. So by changing this command: ansible-navigator run playbooks/hub_config.yml --eei hub.$INSTRUQT_PARTICIPANT_ID.instruqt.io/config_as_code -i inventory.yml -l execution --pa='--tls-verify=false' -m stdout --penv INSTRUQT_PARTICIPANT_ID with ansible-navigator run playbooks/hub_config.yml --eei localhost/config_as_code -i inventory.yml -l execution -m stdout --penv INSTRUQT_PARTICIPANT_ID Now task 5 works. But this is not a good example of usage of AH... we downloaded the EE from quay.io directly into the controller. No need of AH for that.

When I say "works", it's almost the case. AH fails to sync community-infra repository in time making the playbook timeout (but there was 123 retries left in async) and after that AH becomes unresponsive for several minutes. When it comes back, the Repositories Sync status says "Failed" with no other details. I tried a second time, but I'm dangerously close to the end of the lab's timer. I noticed that AH seems gone, the hub-terminal doesn't respond. I looking into the Task management tab, but "Pulp Ansible: Collections sync" error message is empty too.

Here the output of ansible-navigator:

  "msg": "GET error: There was an unknown error when trying to connect to timeout: The read operation timed out https://hub.awaay9y898gc.instruqt.io/api/galaxy/pulp/api/v3/tasks/02ab4d05-c49f-4baf-a274-63ebd60bedc1/",
    "stdout": [
        "",
        "PLAY [Configure private automation hub after installation] *********************",
        "",
        "TASK [Include group role] ******************************************************",
        "\u001b[0;35m[DEPRECATION WARNING]: infra.ah_configuration.ah_group_perm has been \u001b[0m",
        "\u001b[0;35mdeprecated. The endpoint has been removed and is not supported in AAP 2.3 \u001b[0m",
        "\u001b[0;35monwards. This feature will be removed from infra.ah_configuration in version \u001b[0m",
        "\u001b[0;35m3.0.0. Deprecation warnings can be disabled by setting \u001b[0m",
        "\u001b[0;35mdeprecation_warnings=False in ansible.cfg.\u001b[0m",
        "",
        "TASK [infra.ah_configuration.group : Validating arguments against arg spec 'main' - An Ansible Role to create groups in Automation Hub.] ***",
        "\u001b[0;32mok: [localhost]\u001b[0m",
        "",
        "TASK [infra.ah_configuration.group : Add Automation Hub group] *****************",
        "\u001b[0;32mok: [localhost] => (item={'name': 'admin', 'state': 'present'})\u001b[0m",
        "\u001b[1;35m[WARNING]: Distribution rhel 8.8 on host localhost should use\u001b[0m",
        "\u001b[1;35m/usr/libexec/platform-python, but is using /usr/bin/python3.9, since the\u001b[0m",
        "\u001b[1;35mdiscovered platform python interpreter was not present. See\u001b[0m",
        "\u001b[1;35mhttps://docs.ansible.com/ansible-\u001b[0m",
        "\u001b[1;35mcore/2.15/reference_appendices/interpreter_discovery.html for more information.\u001b[0m",
        "",
        "TASK [infra.ah_configuration.group : Create Group | Wait for finish the group creation] ***",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Create Group | Wait for finish the group creation (50 retries left).\u001b[0m",
        "\u001b[0;32mok: [localhost] => (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': 'j378159373742.35', 'results_file': '/root/.ansible_async/j378159373742.35', 'changed': False, 'ansible_facts': {'discovered_interpreter_python': '/usr/bin/python3.9'}, '__group': {'name': 'admin', 'state': 'present'}, 'ansible_loop_var': '__group'})\u001b[0m",
        "",
        "TASK [infra.ah_configuration.group : Add Automation Hub group permissions] *****",
        "\u001b[0;36mskipping: [localhost] => (item={'name': 'admin', 'state': 'present'}) \u001b[0m",
        "\u001b[0;36mskipping: [localhost]\u001b[0m",
        "",
        "TASK [infra.ah_configuration.group : Create Group | Wait for finish the group creation] ***",
        "\u001b[0;36mskipping: [localhost] => (item={'changed': False, 'skipped': True, 'skip_reason': 'Conditional result was False', 'false_condition': '__group.perms is defined', '__group': {'name': 'admin', 'state': 'present'}, 'ansible_loop_var': '__group'}) \u001b[0m",
        "\u001b[0;36mskipping: [localhost]\u001b[0m",
        "",
        "TASK [Include user role] *******************************************************",
        "",
        "TASK [infra.ah_configuration.user : Validating arguments against arg spec 'main' - An Ansible Role to create users in Automation Hub.] ***",
        "\u001b[0;32mok: [localhost]\u001b[0m",
        "",
        "TASK [infra.ah_configuration.user : Add Automation Hub User] *******************",
        "\u001b[0;32mok: [localhost] => (item={'username': 'ah_token_user', 'groups': ['admin'], 'append': True, 'state': 'present'})\u001b[0m",
        "",
        "TASK [infra.ah_configuration.user : Create User | Wait for finish the user creation] ***",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Create User | Wait for finish the user creation (50 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Create User | Wait for finish the user creation (49 retries left).\u001b[0m",
        "\u001b[0;32mok: [localhost] => (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': 'j524843163322.94', 'results_file': '/root/.ansible_async/j524843163322.94', 'changed': False, '__user': {'username': 'ah_token_user', 'groups': ['admin'], 'append': True, 'state': 'present'}, 'ansible_loop_var': '__user'})\u001b[0m",
        "",
        "TASK [Include collection remote role] ******************************************",
        "",
        "TASK [infra.ah_configuration.collection_remote : Validating arguments against arg spec 'main' - An Ansible Role to create collection remotes in Automation Hub.] ***",
        "\u001b[0;32mok: [localhost]\u001b[0m",
        "",
        "TASK [infra.ah_configuration.collection_remote : Add Automation Hub Collection Remote repository] ***",
        "\u001b[0;32mok: [localhost] => (item={'name': 'community-infra', 'url': 'https://galaxy.ansible.com/', 'requirements': [{'name': 'infra.ee_utilities'}, {'name': 'infra.aap_utilities'}, {'name': 'containers.podman'}, {'name': 'awx.awx'}, {'name': 'community.general'}]})\u001b[0m",
        "",
        "TASK [infra.ah_configuration.collection_remote : Create Repository | Wait for finish the repository creation] ***",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Create Repository | Wait for finish the repository creation (50 retries left).\u001b[0m",
        "\u001b[0;32mok: [localhost] => (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': 'j709042713038.164', 'results_file': '/root/.ansible_async/j709042713038.164', 'changed': False, '__collection_remote_item': {'name': 'community-infra', 'url': 'https://galaxy.ansible.com/', 'requirements': [{'name': 'infra.ee_utilities'}, {'name': 'infra.aap_utilities'}, {'name': 'containers.podman'}, {'name': 'awx.awx'}, {'name': 'community.general'}]}, 'ansible_loop_var': '__collection_remote_item'})\u001b[0m",
        "",
        "TASK [Include collection repository role] **************************************",
        "",
        "TASK [infra.ah_configuration.collection_repository : Validating arguments against arg spec 'main' - An Ansible Role to create collection remotes in Automation Hub.] ***",
        "\u001b[0;32mok: [localhost]\u001b[0m",
        "",
        "TASK [infra.ah_configuration.collection_repository : Add Automation Hub Collection Remote repository] ***",
        "\u001b[0;32mok: [localhost] => (item={'name': 'community-infra-repo', 'description': 'description of community-infra repository', 'pulp_labels': {'pipeline': 'approved'}, 'distribution': {'state': 'present'}, 'remote': 'community-infra'})\u001b[0m",
        "",
        "TASK [infra.ah_configuration.collection_repository : Create Repository | Wait for finish the repository creation] ***",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Create Repository | Wait for finish the repository creation (50 retries left).\u001b[0m",
        "\u001b[0;32mok: [localhost] => (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': 'j743472614537.219', 'results_file': '/root/.ansible_async/j743472614537.219', 'changed': False, '__collection_repository_item': {'name': 'community-infra-repo', 'description': 'description of community-infra repository', 'pulp_labels': {'pipeline': 'approved'}, 'distribution': {'state': 'present'}, 'remote': 'community-infra'}, 'ansible_loop_var': '__collection_repository_item'})\u001b[0m",
        "",
        "TASK [Include collection repository role] **************************************",
        "",
        "TASK [infra.ah_configuration.collection_repository_sync : Validating arguments against arg spec 'main' - An Ansible Role to create collection remotes in Automation Hub.] ***",
        "\u001b[0;32mok: [localhost]\u001b[0m",
        "",
        "TASK [infra.ah_configuration.collection_repository_sync : Sync Automation Hub Collection Remote repository] ***",
        "\u001b[0;32mok: [localhost] => (item={'name': 'community-infra-repo', 'description': 'description of community-infra repository', 'pulp_labels': {'pipeline': 'approved'}, 'distribution': {'state': 'present'}, 'remote': 'community-infra'})\u001b[0m",
        "",
        "TASK [infra.ah_configuration.collection_repository_sync : Sync Repository | Wait for finish the repository sync] ***",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (150 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (149 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (148 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (147 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (146 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (145 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (144 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (143 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (142 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (141 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (140 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (139 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (138 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (137 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (136 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (135 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (134 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (133 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (132 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (131 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (130 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (129 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (128 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (127 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (126 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (125 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (124 retries left).\u001b[0m",
        "\u001b[1;30mFAILED - RETRYING: [localhost]: Sync Repository | Wait for finish the repository sync (123 retries left).\u001b[0m",
        "\u001b[0;31mfailed: [localhost] (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': 'j897861683130.274', 'results_file': '/root/.ansible_async/j897861683130.274', 'changed': False, '__collection_repository_sync_item': {'name': 'community-infra-repo', 'description': 'description of community-infra repository', 'pulp_labels': {'pipeline': 'approved'}, 'distribution': {'state': 'present'}, 'remote': 'community-infra'}, 'ansible_loop_var': '__collection_repository_sync_item'}) => {\"__collection_repository_sync_job_async_result_item\": {\"__collection_repository_sync_item\": {\"description\": \"description of community-infra repository\", \"distribution\": {\"state\": \"present\"}, \"name\": \"community-infra-repo\", \"pulp_labels\": {\"pipeline\": \"approved\"}, \"remote\": \"community-infra\"}, \"ansible_job_id\": \"j897861683130.274\", \"ansible_loop_var\": \"__collection_repository_sync_item\", \"changed\": false, \"failed\": 0, \"finished\": 0, \"results_file\": \"/root/.ansible_async/j897861683130.274\", \"started\": 1}, \"ansible_job_id\": \"j897861683130.274\", \"ansible_loop_var\": \"__collection_repository_sync_job_async_result_item\", \"attempts\": 29, \"changed\": false, \"finished\": 1, \"msg\": \"GET error: There was an unknown error when trying to connect to timeout: The read operation timed out https://hub.awaay9y898gc.instruqt.io/api/galaxy/pulp/api/v3/tasks/02ab4d05-c49f-4baf-a274-63ebd60bedc1/\", \"results_file\": \"/root/.ansible_async/j897861683130.274\", \"started\": 1, \"stderr\": \"\", \"stderr_lines\": [], \"stdout\": \"\", \"stdout_lines\": []}\u001b[0m",
        "",
        "PLAY RECAP *********************************************************************",
        "\u001b[0;31mlocalhost\u001b[0m                  : \u001b[0;32mok=14  \u001b[0m changed=0    unreachable=0    \u001b[0;31mfailed=1   \u001b[0m \u001b[0;36mskipped=2   \u001b[0m rescued=0    ignored=0   "
    ],
    "version": "2.0.0"
}
abenokraitis commented 10 months ago

@sean-m-sullivan FYI

sean-m-sullivan commented 10 months ago

Got it, Laurent started in our Community channel https://app.element.io/#/room/#aap_config_as_code:ansible.com

Looking into it.

sean-m-sullivan commented 7 months ago

I believe this is fixed, please try again, sorry for the delay.

laurent-indermuehle commented 7 months ago

@sean-m-sullivan I've redone the lab2 and this time everything worked! Thanks you for the fix!