Created attachment 1595273 [details] Playbook to reproduce the problem Description of problem: The manageiq-core.manageiq-automate role is not shipped with CloudForms (in /var/www/miq/vmdb/content/ansible_consolidated/roles/manageiq-core.manageiq-automate), however Embedded Ansible does not find it. Running a playbook with the following yaml: roles: - manageiq-core.manageiq-automate Results in the following being written to evm.log: [----] W, [2019-07-31T16:55:07.677512 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at 'ERROR! the role 'manageiq-core.manageiq-automate' was not found in /tmp/ansible-playbook-repo20190731-8940-r7jwcf/roles:/root/.ansible/roles:/usr/sha re/ansible/roles:/etc/ansible/roles:/tmp/ansible-playbook-repo20190731-8940-r7jwcf ' [----] W, [2019-07-31T16:55:07.677713 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at '' [----] W, [2019-07-31T16:55:07.677767 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at 'The error appears to be in '/tmp/ansible-playbook-repo20190731-8940-r7jwcf/manageiq_automate_role_examples.yml': line 11, column 5, but may ' [----] W, [2019-07-31T16:55:07.677815 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at 'be elsewhere in the file depending on the exact syntax problem. ' [----] W, [2019-07-31T16:55:07.677864 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at '' [----] W, [2019-07-31T16:55:07.677908 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at 'The offending line appears to be: ' [----] W, [2019-07-31T16:55:07.677953 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at '' [----] W, [2019-07-31T16:55:07.677999 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at 'roles: ' [----] W, [2019-07-31T16:55:07.678043 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at '- manageiq-core.manageiq-automate ' [----] W, [2019-07-31T16:55:07.678085 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(Ansible::Runner::Response#parse_stdout) Couldn't parse JSON from: 765: unexpected token at '^ here ' [----] W, [2019-07-31T16:55:07.816800 #8931:2ac23e5fe5bc] WARN -- : Q-task_id([90f5a65e-6bf2-465a-a530-cf1cb59a28ad]) MIQ(ManageIQ::Providers::AnsiblePlaybookWorkflow#poll_runner) Playbook failed: Version-Release number of selected component (if applicable): 5.11.0.17 How reproducible: Every time Steps to Reproduce: 1. Create a playbook that references the built-in manageiq-core.manageiq-automate role 2. Run the playbook from Embedded Ansible Actual results: The playbook will fail to locate the role Expected results: The playbook should locate and run the role Additional info: The attached playbook illustrates the problem
Peter, I made some changes and I'm now seeing the playbook make an attempt to run something that looks like it's coming from the role, but it's still failing. I'm not sure if this is intended (or some bug in the role). What do you think? Here's the output I'm getting with my changes: [----] I, [2019-07-31T15:53:07.528940 #13951:2b098d0725bc] INFO -- : Q-task_id([r5_service_template_provision_task_5]) MIQ(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::PlaybookRunner#log_stdout) Stdout from playbook manageiq-automate_role_bug_example.yml: PLAY [manageiq-automate role bug example] ************************************** TASK [manageiq-core.manageiq-automate : Initialize the Workspace] ************** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'dict' object has no attribute 'iteritems' fatal: [localhost]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1564602748.1169078-260481528705529/AnsiballZ_manageiq_automate.py\", line 114, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1564602748.1169078-260481528705529/AnsiballZ_manageiq_automate.py\", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1564602748.1169078-260481528705529/AnsiballZ_manageiq_automate.py\", line 49, in invoke_module\n imp.load_module('__main__', mod, module, MOD_DESC)\n File \"/usr/lib64/python3.6/imp.py\", line 235, in load_module\n return load_source(name, filename, file)\n File \"/usr/lib64/python3.6/imp.py\", line 170, in load_source\n module = _exec(spec, sys.modules[name])\n File \"<frozen importlib._bootstrap>\", line 618, in _exec\n File \"<frozen importlib._bootstrap_external>\", line 678, in exec_module\n File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n File \"/tmp/ansible_manageiq_automate_payload_mwfakkab/__main__.py\", line 503, in <module>\n File \"/tmp/ansible_manageiq_automate_payload_mwfakkab/__main__.py\", line 489, in main\nAttributeError: 'dict' object has no attribute 'iteritems'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} PLAY RECAP ********************************************************************* localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
It looks like we're now using Python3 and iteritems has been removed (https://www.python.org/dev/peps/pep-0469/). This would indeed seem to be a bug with the manageiq-core.manageiq-automate role, but may also have implications with other roles.
Indeed, python 3 is now the default version in RHEL 8 https://developers.redhat.com/blog/2018/11/14/python-in-rhel-8/
I've just noticed that the original description should read: The manageiq-core.manageiq-automate role is now shipped with CloudForms ^
New commit detected on ManageIQ/manageiq-appliance/master: https://github.com/ManageIQ/manageiq-appliance/commit/2ea7fe4d184bf381e9c08f4bae19ddd84b4da92f commit 2ea7fe4d184bf381e9c08f4bae19ddd84b4da92f Author: Nick Carboni <ncarboni> AuthorDate: Thu Aug 1 15:57:52 2019 -0400 Commit: Nick Carboni <ncarboni> CommitDate: Thu Aug 1 15:57:52 2019 -0400 Correct the ansible config section name The ini file section name is "defaults" not "default" This is why the roles path change was being ignored. ref: https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-roles-path Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1734902 LINK/root/.ansible.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commit detected on ManageIQ/manageiq-appliance/ivanchuk: https://github.com/ManageIQ/manageiq-appliance/commit/10e7d53685ef0677c0f0b158f02aa80fc5ab2a86 commit 10e7d53685ef0677c0f0b158f02aa80fc5ab2a86 Author: Jason Frey <jfrey> AuthorDate: Thu Aug 1 16:10:01 2019 -0400 Commit: Jason Frey <jfrey> CommitDate: Thu Aug 1 16:10:01 2019 -0400 Merge pull request #249 from carbonin/use_correct_section_header Correct the ansible config section name (cherry picked from commit 086bddb1d9c6be9e0c03c509fd0f661458523be5) https://bugzilla.redhat.com/show_bug.cgi?id=1734902 LINK/root/.ansible.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Error in this BZ has been fixed in --> https://bugzilla.redhat.com/show_bug.cgi?id=1738542
After running attached playbook in simulation, able to see it is using added role without any error. Also, the BZ causing error(see comment 2) has been fixed. Verified Version: 5.11.0.19.20190813184334_ed72c9f