Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding multiple hosts from ansible fails due to multiple outstanding create operations simultanous #7

Open
np422 opened this issue Aug 28, 2017 · 2 comments
Assignees
Labels

Comments

@np422
Copy link
Owner

np422 commented Aug 28, 2017

TASK [op5-add-host : Register client with Op5 monitoring server] *************************************************************************************************
fatal: [epr-int-bpm-a -> localhost]: FAILED! => {"changed": true, "cmd": "op5util -u int-appAnsibleOp5 -p ZsdJCc6AvhDRvXUa6w9L -m 10.30.20.21 add -g conextrade-windows-SOE-base epr-int-bpm-a", "delta": "0:00:01.209163", "end": "2017-08-28 15:41:24.824721", "failed": true, "rc": 1, "start": "2017-08-28 15:41:23.615558", "stderr": "error: Response code: 500, Message: {"error":"Export failed","full_error":{"type":"save in progress"}}", "stderr_lines": ["error: Response code: 500, Message: {"error":"Export failed","full_error":{"type":"save in progress"}}"], "stdout": "New host created\nError, Response code: 500, Message: {"error":"Export failed","full_error":{"type":"save in progress"}}", "stdout_lines": ["New host created", "Error, Response code: 500, Message: {"error":"Export failed","full_error":{"type":"save in progress"}}"]}
changed: [epr-int-proc-a -> localhost]

jag körde två host:ar på en gång
ops@epr-int-adm:~/ansible-epr-inf$ ansible-playbook -i inventories/int/inventory.int playbooks/soe-windows.yml -l epr-int-proc-a,epr-int-bpm-a

@np422 np422 self-assigned this Aug 28, 2017
@np422 np422 added the bug label Aug 28, 2017
@np422
Copy link
Owner Author

np422 commented Aug 28, 2017

A --no-commit switch to the add commands and a commit command will probably solve this issue.

@maglub
Copy link
Collaborator

maglub commented Nov 14, 2017

Could then be fixed in ansible with:

register: commit op5

And a handler:

- name: commit op5
    shell: op5util -u {{ op5User }} -p {{ op5Password }} -m {{ op5Server }} add -g {{ op5Hostgroups | default([ 'linux_hosts' ])  | join(' -g ') }} {{ inventory_hostname }}
    delegate_to: localhost

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants