-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpythontest.yml
30 lines (26 loc) · 943 Bytes
/
pythontest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- name: PythonTest
hosts: all
gather_facts: false
vars:
output_path: "/home/ansiblereports/"
filename: "{{ switch }}_free_interfaces_{{ date }}.csv"
filename2: "{{ switch }}_free_interfaces2_{{ date }}.csv"
filename3: "{{ switch }}_free_interfaces3_{{ date }}.csv"
filename4: "{{ switch }}_free_interfaces4_{{ date }}.csv"
filenamevlan: "{{ switch }}_free_interfacesvlan_{{ date }}.csv"
temp_path: "/home/ansiblereports/temp.csv"
full_path: "/home/ansiblereports/free_interfaces_{{ date }}.csv"
tasks:
- name: Python version
ansible.builtin.command: python --version
- name: Python commands
ansible.builtin.command: python
args:
stdin: |
import sys
print (sys.path)
- name: Python code for inner join of the CSVs
ansible.builtin.script: iosfreeinterfaces.py
args:
executable: python3
delegate_to: localhost