GG
Size: a a a
GG
AS
AS
t
TG
TG
t
TG
TG
TG
GG
GG
AS
Boolean that will bypass the host loop, forcing the task to attempt to execute on the first host available and afterwards apply any results and facts to all active hosts in the same batch.
AS
AS
- block:
- name: current machine
set_fact:
skip_node: "{{ ansible_host }}"
- name: echo 1
shell: echo 1
run_once: true
- name: echo 2
shell: |
echo 2
when: skip_node != ansible_host
AS
- block:а таску по рестарту whisky помести в handlers
- name: mastersrv server
set_fact:
skip_server: "{{ ansible_host }}"
- name: "run on first found host"
template:
src: mastersrv.conf
dest: /etc/whisky/main.conf
owner: root
group: root
mode: 0600
notify:
- restart whisky
run_once: true
- name: "run on other hosts execpt first found host"
template:
src: slave.conf
dest: /etc/whisky/main.conf
owner: root
group: root
mode: 0600
when: skip_server != ansible_host
notify:
- restart whisky
VL
- block:а таску по рестарту whisky помести в handlers
- name: mastersrv server
set_fact:
skip_server: "{{ ansible_host }}"
- name: "run on first found host"
template:
src: mastersrv.conf
dest: /etc/whisky/main.conf
owner: root
group: root
mode: 0600
notify:
- restart whisky
run_once: true
- name: "run on other hosts execpt first found host"
template:
src: slave.conf
dest: /etc/whisky/main.conf
owner: root
group: root
mode: 0600
when: skip_server != ansible_host
notify:
- restart whisky
VS
VS