Create jira issue in ansible

630 views
Skip to first unread message

Ivo Hechmann

unread,
Jul 13, 2016, 8:14:08 AM7/13/16
to Ansible Project
Hello Team ansible.

Since upgrade to 2.1.0.0, I cannot use the jira module anymore.

Error message is "fatal: [hostname]: FAILED! => {"changed": false, "failed": true, "msg": "dictionary update sequence element #0 has length 1; 2 is required"}"

The playbook Looks like

- hosts: xxxx

  tasks:
  - name: (JIRA) Sample ansible issue
    jira: description=something issuetype=Bug operation=create password=XXXX project=xxx summary=test uri=https://hostname.com username=XXX



Output in ansible 2.1.0.0:

asrun@asrun-VirtualBox:~/ansible$ ansible --version
ansible 2.1.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
asrun@asrun-VirtualBox:~/ansible$ ansible-playbook --private-key sshkeys/my.privatekey  pb-jira-create/test.yml
PLAY [xxxx] **************************************************************
TASK [setup] *******************************************************************
Enter passphrase for key 'sshkeys/my.privatekey':
ok: [host.com]
TASK [(JIRA) Sample ansible issue] *********************************************
fatal: [host.com]: FAILED! => {"changed": false, "failed": true, "msg": "dictionary update sequence element #0 has length 1; 2 is required"}
NO MORE HOSTS LEFT *************************************************************
 to retry, use: --limit @pb-jira-create/test.retry
PLAY RECAP *********************************************************************
host.com         : ok=1    changed=0    unreachable=0    failed=1  

Output same playbook in ansible 1.7.2:

asrun@asrun-VirtualBox:~/ansible$ sudo ansible --version
ansible 1.7.2
asrun@asrun-VirtualBox:~/ansible$ ansible-playbook --private-key sshkeys/my.privatekey  pb-jira-create/test.yml
PLAY [xxxx] *************************************************************
GATHERING FACTS ***************************************************************
Enter passphrase for key 'sshkeys/my.privatekey':
ok: [host.com]
TASK: [(JIRA) Sample ansible issue] *******************************************
changed: [host.com]
PLAY RECAP ******************************************************************** 
host.com         : ok=2    changed=1    unreachable=0    failed=0


Can anyone confirm jira module still working in 2.1.0.0?

Thank you very much

Ivo

J Hawkesworth

unread,
Jul 13, 2016, 8:35:54 AM7/13/16
to Ansible Project
I think I had something like this.  I think I fixed it by changing to 'yaml style' arguments instead of the key=value arguments.  So try something like:

jira: 
  description:something 
  issuetype: Bug
  operation: create
  password: XXXX 
  project: xxx 
  summary:test 
  username: XXX

I am running 2.0.0.2 right now actually, so possibly different in 2.1

Hope this helps

Ivo Hechmann

unread,
Jul 14, 2016, 3:49:39 AM7/14/16
to Ansible Project
Yay, that did solve the Problem, module works in 2.1.0.0!
Thank you very much

Ivo
Reply all
Reply to author
Forward
0 new messages