You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When configuring gateway from a user_accounts.yaml file, the first time it runs without any problem.
But when the same file is used to add a user, the playbook fails on exsisting users, it seems that the module is
missing idempotency.
<aap_dev> ESTABLISH LOCAL CONNECTION FOR USER: wilco<aap_dev> EXEC /bin/sh -c 'echo ~wilco && sleep 0'<aap_dev> EXEC /bin/sh -c 'echo ~wilco && sleep 0'<aap_dev> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/wilco/.ansible/tmp `"&& mkdir "` echo /home/wilco/.ansible/tmp/ansible-tmp-1734516996.791021-7969-44740564126468 `" && echo ansible-tmp-1734516996.791021-7969-44740564126468="` echo /home/wilco/.ansible/tmp/ansible-tmp-1734516996.791021-7969-44740564126468 `" ) && sleep 0'Using module file /home/wilco/.local/lib/python3.9/site-packages/ansible/modules/async_status.py<aap_dev> PUT /home/wilco/.ansible/tmp/ansible-local-71397_aaod7_/tmpxuonher3 TO /home/wilco/.ansible/tmp/ansible-tmp-1734516996.791021-7969-44740564126468/AnsiballZ_async_status.py<aap_dev> EXEC /bin/sh -c 'chmod u+x /home/wilco/.ansible/tmp/ansible-tmp-1734516996.791021-7969-44740564126468/ /home/wilco/.ansible/tmp/ansible-tmp-1734516996.791021-7969-44740564126468/AnsiballZ_async_status.py && sleep 0'<aap_dev> EXEC /bin/sh -c '/usr/bin/python3 /home/wilco/.ansible/tmp/ansible-tmp-1734516996.791021-7969-44740564126468/AnsiballZ_async_status.py && sleep 0'<aap_dev> EXEC /bin/sh -c 'rm -f -r /home/wilco/.ansible/tmp/ansible-tmp-1734516996.791021-7969-44740564126468/ > /dev/null 2>&1 && sleep 0'failed: [aap_dev] (item=Create/Update Gateway user mgt | Wait for finish the Gateway user creation) => { "__gateway_user_accounts_job_async_results_item": { "__gateway_user_accounts_item": { "email": null, "first_name": "user", "last_name": "platform management", "password": "some_pass", "update_secrets": false, "username": "mgt" }, "ansible_job_id": "j514521925947.7742", "ansible_loop_var": "__gateway_user_accounts_item", "changed": false, "failed": 0, "finished": 0, "results_file": "/home/wilco/.ansible_async/j514521925947.7742", "started": 1 }, "ansible_job_id": "j514521925947.7742", "ansible_loop_var": "__gateway_user_accounts_job_async_results_item", "attempts": 1, "changed": false, "cmd": "/home/wilco/.ansible/tmp/ansible-tmp-1734516991.822762-7729-117570209327651/AnsiballZ_user.py", "data": "", "finished": 1, "invocation": { "module_args": { "_async_dir": "/home/wilco/.ansible_async", "jid": "j514521925947.7742", "mode": "status" } }, "msg": "Traceback (most recent call last):\n File \"/tmp/ansible_ansible.legacy.async_wrapper_payload_atzk61fz/ansible_ansible.legacy.async_wrapper_payload.zip/ansible/modules/async_wrapper.py\", line 180, in _run_module\n File \"/tmp/ansible_ansible.legacy.async_wrapper_payload_atzk61fz/ansible_ansible.legacy.async_wrapper_payload.zip/ansible/modules/async_wrapper.py\", line 98, in _filter_non_json_lines\nValueError: No start of json char found\n", "results_file": "/home/wilco/.ansible_async/j514521925947.7742", "started": 1,
"stderr": "Traceback (most recent call last):\n File \"/home/wilco/.ansible/tmp/ansible-tmp-1734516991.822762-7729-117570209327651/AnsiballZ_user.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/wilco/.ansible/tmp/ansible-tmp-1734516991.822762-7729-117570209327651/AnsiballZ_user.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/wilco/.ansible/tmp/ansible-tmp-1734516991.822762-7729-117570209327651/AnsiballZ_user.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.ansible.platform.plugins.modules.user', init_globals=dict(_module_fqn='ansible_collections.ansible.platform.plugins.modules.user', _modlib_path=modlib_path),\n File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/modules/user.py\", line 125, in <module>\n File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/modules/user.py\", line 121, in main\n File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/module_utils/aap_object.py\", line 66, in manage\n File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/module_utils/aap_module.py\", line 407, in create_or_update_if_needed\n File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/module_utils/aap_module.py\", line 518, in update_if_needed\n File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/module_utils/aap_module.py\", line 710, in objects_could_be_different\nAttributeError: 'AAPModule' object has no attribute 'fields_could_be_same'\n",
"stderr_lines": [ "Traceback (most recent call last):", " File \"/home/wilco/.ansible/tmp/ansible-tmp-1734516991.822762-7729-117570209327651/AnsiballZ_user.py\", line 107, in <module>", " _ansiballz_main()", " File \"/home/wilco/.ansible/tmp/ansible-tmp-1734516991.822762-7729-117570209327651/AnsiballZ_user.py\", line 99, in _ansiballz_main", " invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)", " File \"/home/wilco/.ansible/tmp/ansible-tmp-1734516991.822762-7729-117570209327651/AnsiballZ_user.py\", line 47, in invoke_module", " runpy.run_module(mod_name='ansible_collections.ansible.platform.plugins.modules.user', init_globals=dict(_module_fqn='ansible_collections.ansible.platform.plugins.modules.user', _modlib_path=modlib_path),", " File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module", " return _run_module_code(code, init_globals, run_name, mod_spec)", " File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code", " _run_code(code, mod_globals, init_globals,", " File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code", " exec(code, run_globals)", " File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/modules/user.py\", line 125, in <module>", " File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/modules/user.py\", line 121, in main", " File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/module_utils/aap_object.py\", line 66, in manage", " File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/module_utils/aap_module.py\", line 407, in create_or_update_if_needed", " File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/module_utils/aap_module.py\", line 518, in update_if_needed", " File \"/tmp/ansible_ansible.platform.user_payload_k6eqfhha/ansible_ansible.platform.user_payload.zip/ansible_collections/ansible/platform/plugins/module_utils/aap_module.py\", line 710, in objects_could_be_different", "AttributeError: 'AAPModule' object has no attribute 'fields_could_be_same'" ], "stdout": "", "stdout_lines": []}
STEPS TO REPRODUCE
create the playbook and the configuration file as shown in this bug report and run this configuration twice against the same installation and it will give the error shown.
The playbook used in the above bug desciption will do the trick
The text was updated successfully, but these errors were encountered:
Summary
When configuring gateway from a user_accounts.yaml file, the first time it runs without any problem.
But when the same file is used to add a user, the playbook fails on exsisting users, it seems that the module is
missing idempotency.
Issue Type
Ansible, Collection, Controller details
OS / ENVIRONMENT
Desired Behavior
The playbook/role should only add the new user and report [ok] when the esisting users are not changed.
Actual Behavior
Please give some details of what is actually happening.
Include a [minimum complete verifiable example] with:
STEPS TO REPRODUCE
create the playbook and the configuration file as shown in this bug report and run this configuration twice against the same installation and it will give the error shown.
The playbook used in the above bug desciption will do the trick
The text was updated successfully, but these errors were encountered: