Files
tp_ssh/eval.yml
2020-09-30 14:36:08 +02:00

36 lines
706 B
YAML

---
- hosts:
- b2
gather_facts: false
vars:
result_file: "tp_ssh.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