43 lines
942 B
YAML
43 lines
942 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 }}"
|
|
|
|
- name: get latest version of functions.sh
|
|
git:
|
|
repo: ssh://infra.opendoor.fr:2222/srv/git/repos/tom/eval_functions.git
|
|
dest: root/eval_functions.git
|
|
|
|
- name: exec script
|
|
command: /root/eval.sh
|
|
register: result
|
|
|
|
- name: get result
|
|
lineinfile:
|
|
path: "{{ result_file }}"
|
|
line: "{{ result.stdout }}"
|
|
create: true
|
|
delegate_to: localhost |