V
V
Venot2020-07-13 15:18:36
Jenkins
Venot, 2020-07-13 15:18:36

How to run multiple scripts on the same host at the same time in Ansible playbook?

in jenkins, the selected applications are written to the variable, then the playbook is executed:
- name: Change the state of clusters
hosts: "{{ Cluster }}"
gather_facts: no
tasks:
- name: action app
shell: admin/{{ ids[item] }}_mgmt .sh {{ ClusterAction3 | default('status') }}
with_items: "{{ Cluster.split(',') }}"
register: shell_result
run_once: yes
tags: single
turns out 1 script won't run yet, 2 won't run, how to make it run simultaneously all scripts, wait until the last one is executed, display the result of the work through debug.
or in jenkins run each ansible playbook in parallel, or is it possible to implement this in a playbook?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
paran0id, 2020-07-13
@Venot

https://docs.ansible.com/ansible/latest/user_guide...
something like this

P
Puma Thailand, 2020-07-13
@opium

when launched on a group of hosts, ansible itself launches everything in parallel

L
Lorem Ipsum, 2014-12-07
@nobodynoone

It needs to be compiled, if you are too lazy to do this, then you can always download the compiled version of the library from the site lfd.uci.edu .

A
Alexander, 2014-12-08
@syschel

Not an answer to the current question. But help in general.
I hear you want to do parsing. When I switched from php to python. And there was a task to parse several sites. Also the first thought was in the direction of pycurl. But I learned a lot from him.
But then I discovered the urllib and urllib2 libraries .
I advise you to use them. Unless you understand python.
For parsing by labels (tags), the following library is convenient: lxml It is convenient to download
for Windows here . For not all packages in Windows are compiled. And then immediately the installers are specifically for Windows.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question