37 lines
729 B
YAML
37 lines
729 B
YAML
---
|
|
- hosts:
|
|
- b2
|
|
user: root
|
|
gather_facts: false
|
|
vars:
|
|
result_file: "tp_prise_en_main.csv"
|
|
|
|
pre_tasks:
|
|
- name: insert header
|
|
lineinfile:
|
|
path: "{{ result_file }}"
|
|
line: "machine\tuser\tmotd\tuser epsi\tpassword epsi\tinventaire reseau\tpractice done\tsudo installed"
|
|
state: present
|
|
create: true
|
|
delegate_to: localhost
|
|
|
|
tasks:
|
|
- name: copy script
|
|
copy:
|
|
src: "{{ item }}"
|
|
dest: /root
|
|
mode: 0700
|
|
loop:
|
|
- functions.sh
|
|
- eval.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 |