https://docs.ansible.com/ansible/2.9_ja/modules/jenkins_job_info_module.html not printing info for mutlpipleine jobs

28 views
Skip to first unread message

Narmada Karthika

unread,
Jun 22, 2023, 2:42:22 PM6/22/23
to Ansible Project
here is my jenkins info play

 - name: Print the jobname
      jenkins_job_facts:
        name: 'build.teamCI'
        user: nchi...@domain.com
        token: <token>
        url: https://build.com
      register: my_jenkins_job_info
      tags: jenkinsjob2

the above play is printing info for jobs which are not multipipline. if I give multipipeline jobs its failing.
Is there any work around or am I missing anything...

Narmada Karthika

unread,
Jun 22, 2023, 3:00:46 PM6/22/23
to ansible...@googlegroups.com
My bad corrected the module name 

On Thu, Jun 22, 2023 at 11:42 AM Narmada Karthika <chitt...@gmail.com> wrote:
here is my jenkins info play

 - name: Print the jobname
      jenkins_job_info:

        name: 'build.teamCI'
        user: nchi...@domain.com
        token: <token>
        url: https://build.com
      register: my_jenkins_job_info
      tags: jenkinsjob2

the above play is printing info for jobs which are not multipipline. if I give multipipeline jobs its failing.
Is there any work around or am I missing anything...

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1c8810d2-adad-4160-8c5c-3291e42ca203n%40googlegroups.com.
--
 Thanks,
Narmada Karthika Chitturi
 

Narmada Karthika

unread,
Jun 22, 2023, 4:53:55 PM6/22/23
to Ansible Project
this is the failure message I get 
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/deploy-user/.ansible/tmp/ansible-tmp-1687467074.902748-21679-1695874315533/AnsiballZ_jenkins_job_info.py\", line 100, in <module>\n    _ansiballz_main()\n  File \"/home/deploy-user/.ansible/tmp/ansible-tmp-1687467074.902748-21679-1695874315533/AnsiballZ_jenkins_job_info.py\", line 92, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/deploy-user/.ansible/tmp/ansible-tmp-1687467074.902748-21679-1695874315533/AnsiballZ_jenkins_job_info.py\", line 41, in invoke_module\n    run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_jenkins_job_info_payload_k3zaq5p6/ansible_jenkins_job_info_payload.zip/ansible_collections/community/general/plugins/modules/jenkins_job_info.py\", line 262, in <module>\n  File \"/tmp/ansible_jenkins_job_info_payload_k3zaq5p6/ansible_jenkins_job_info_payload.zip/ansible_collections/community/general/plugins/modules/jenkins_job_info.py\", line 252, in main\n  File \"/tmp/ansible_jenkins_job_info_payload_k3zaq5p6/ansible_jenkins_job_info_payload.zip/ansible_collections/community/general/plugins/modules/jenkins_job_info.py\", line 204, in get_jobs\nKeyError: 'color'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1

Narmada Karthika

unread,
Jun 23, 2023, 10:11:49 AM6/23/23
to ansible...@googlegroups.com
Can some one please help
With this 

Abhijeet Kasurde

unread,
Jun 23, 2023, 12:35:57 PM6/23/23
to ansible...@googlegroups.com
Hi Narmada,

It seems that jenkins_job_info module has a bug. You might want to file a bug using https://github.com/ansible-collections/community.general/issues/new/choose. A maintainer or community member might help you out.

Sadly I don't have Jenkins server or access to one.



--
Thanks,
Abhijeet Kasurde

Narmada Karthika

unread,
Jun 23, 2023, 1:05:30 PM6/23/23
to ansible...@googlegroups.com
thank you, I will do that..

Reply all
Reply to author
Forward
0 new messages