tp ssh : initial commit
This commit is contained in:
39
0eval.yml
Normal file
39
0eval.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- hosts: b1
|
||||
user: root
|
||||
gather_facts: false
|
||||
vars_prompt:
|
||||
- name: script
|
||||
prompt: "script? "
|
||||
private: false
|
||||
- name: result_file
|
||||
prompt: "result file ? "
|
||||
private: false
|
||||
|
||||
pre_tasks:
|
||||
- name: insert header
|
||||
lineinfile:
|
||||
path: "{{ result_file }}"
|
||||
line: "machine\tuser\tquestions.."
|
||||
state: present
|
||||
create: true
|
||||
delegate_to: localhost
|
||||
|
||||
tasks:
|
||||
- name: copy script
|
||||
copy:
|
||||
src: "{{ script }}"
|
||||
dest: /root
|
||||
mode: 0700
|
||||
|
||||
- name: exec script
|
||||
command: "/root/{{ script }}"
|
||||
register: result
|
||||
|
||||
post_tasks:
|
||||
- name: get result
|
||||
lineinfile:
|
||||
path: "{{ result_file }}"
|
||||
line: "{{ result.stdout }}"
|
||||
create: true
|
||||
delegate_to: localhost
|
||||
Reference in New Issue
Block a user