39 lines
802 B
YAML
39 lines
802 B
YAML
---
|
|
- hosts:
|
|
- all
|
|
user: epsi
|
|
become: true
|
|
gather_facts: false
|
|
vars:
|
|
result_file: "{{ '%Y-%m-%d' | strftime }}_tp.csv"
|
|
script: eval.sh
|
|
|
|
# pre_tasks:
|
|
# - name: insert header
|
|
# lineinfile:
|
|
# path: "{{ result_file }}"
|
|
# line: "machine\tuser\tdir bin\tscript exists\tif\tmysqldump\texit\targ0\targ1\targ2\trc\tdate\texecOk\ttaille"
|
|
# state: present
|
|
# create: true
|
|
# delegate_to: localhost
|
|
|
|
tasks:
|
|
- name: copy script
|
|
copy:
|
|
src: "{{ item }}"
|
|
dest: /root
|
|
mode: 0700
|
|
loop:
|
|
- "{{ script }}"
|
|
- "functions.sh"
|
|
|
|
- name: exec script
|
|
command: /root/eval.sh
|
|
register: result
|
|
|
|
- name: get result
|
|
lineinfile:
|
|
path: "{{ result_file }}"
|
|
line: "{{ result.stdout }}"
|
|
create: true
|
|
delegate_to: localhost |