-
Notifications
You must be signed in to change notification settings - Fork 9
/
windowstest2.yaml
60 lines (54 loc) · 1.53 KB
/
windowstest2.yaml
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- name: Check what is running on the container
hosts: localhost
connection: local
gather_facts: false
tasks:
- shell: |
whoami
curl ifconfig.me
echo ""
pwd
ps -ef
#ls -las /root/keys
#echo Looking for ssh-agent
#ps -ef | grep ssh-agent | grep -v grep
#echo Looking for ssh
#ps -ef | grep ssh | grep -v ssh-agent | grep -v grep
source /root/ssh-agent.env
echo SSH_AGENT_PID=$SSH_AGENT_PID
echo SSH_AUTH_SOCK=$SSH_AUTH_SOCK
#ssh-add -l
- shell: |
source /root/ssh-agent.env > /dev/null
echo '{"SSH_AUTH_SOCK":"'$SSH_AUTH_SOCK'","SSH_AGENT_PID":"'$SSH_AGENT_PID'"}'
register: env_vars_stdout
- set_fact:
env_vars: "{{ env_vars_stdout.stdout }}"
- hosts: all
gather_facts: no
tasks:
- name: Do Ping
win_ping:
register: ping_output
ignore_unreachable: true
- debug:
var: ping_output
- win_shell: set
args:
executable: cmd
register: homedir_out
# Works on Windows 2016 and 2008 only if someone is logged in using that Userid
#- win_shell: echo '%HOMEDRIVE%%HOMEPATH%'
- win_shell: echo %SystemRoot% %USERPROFILE%
args:
executable: cmd
register: homedir_out
- debug:
var: homedir_out
- name: get powershell version
raw: $PSVersionTable
- name: Copying files to all Windows Endpoints
win_copy:
content: abc123
#src : "windowstest.yaml"
dest: C:\Temp\foo.txt