tp_ssh mise au point

This commit is contained in:
2020-09-28 11:26:36 +02:00
parent a4c81a00c9
commit 7c5bea1530
3 changed files with 50 additions and 1 deletions

38
eval.yml Normal file
View File

@@ -0,0 +1,38 @@
---
- hosts:
- b2
user: epsi
become: true
gather_facts: false
vars:
result_file: "tp_prise_en_main.csv"
pre_tasks:
- name: insert header
lineinfile:
path: "{{ result_file }}"
line: "machine\tuser\tauth keys etu\tauth key tom\tallow groups/user\tpermit root login\tpassword auth"
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