-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployWin.yml
More file actions
59 lines (51 loc) · 1.54 KB
/
deployWin.yml
File metadata and controls
59 lines (51 loc) · 1.54 KB
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
---
- name: Deploy and build
hosts: workers
gather_facts: no
vars:
remoteHost: "localhost"
remoteUser: "user"
remoteDir: "~/"
mountPoint: "X:"
makeBuild: "build"
makeExecutable: "executable"
tasks:
- name: Copy mount script
win_copy:
src: 'dcc-mount.bat'
dest: 'C:/'
- name: Mount remote location
win_shell: "cmd.exe /c dcc-mount.bat"
args:
chdir: 'C:\'
- name: Check if there is work to do
win_stat:
path: '{{mountPoint}}:\{{ansible_ssh_host}}'
register: work_to_do
- name: Build source code
win_shell: "make {{makeBuild}} -j (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors"
args:
chdir: '{{mountPoint}}:\{{ansible_ssh_host}}'
when: work_to_do.stat.exists
- name: Create executable
hosts: master
gather_facts: no
tasks:
- name: Build the executeable
win_shell: "make {{makeExecutable}} -j (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors"
args:
chdir: '{{mountPoint}}:\{{ansible_ssh_host}}'
- name: Clean up
hosts: workers
gather_facts: no
tasks:
- name: Remove folder
win_file:
state: absent
path: '{{mountPoint}}:\{{ansible_ssh_host}}'
- name: Remove dcc-mount.bat
win_file:
state: absent
path: 'C:\dcc-mount.bat'
- name: Unmount remote location
win_shell: "net use {{mountPoint}}: /delete"