-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcdk-windows-installation-playbook.yml
59 lines (48 loc) · 2.21 KB
/
cdk-windows-installation-playbook.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
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
---
#- name: Pre-Play for Windows CDK installation playbook
# hosts: linux_machine
# tasks:
# - get_url: url="http://cdk-builds.usersys.redhat.com/builds/nightly/latest-build/" dest=/home/naina/avocado-installation/index.html
# ignore_errors: True
# - shell: grep hyperv index.html | awk -F "href" '{print $2}' | cut -d '"' -f2 | grep -v sha256sum
# register: foo_result1
# ignore_errors: True
- name: Windows CDK installation playbook
hosts: win_machine
tasks:
- win_file: path='XYZ' state=directory
- win_get_url: url='http://cdk-builds.usersys.redhat.com/builds/nightly/latest-build/cdk.zip' dest="C:\Users\cdk\XYZ\cdk_automation.zip"
- raw:
((Invoke-WebRequest -Uri 'http://cdk-builds.usersys.redhat.com/builds/nightly/latest-build').Links | Where-Object {$_.href -like "rhel*"} | Where innerHTML -like "rhel*").href | Select -index 2
register: foo_result1
ignore_errors: yes
when: ansible_distribution == 'Microsoft Windows NT 10.0.10586.0'
- win_get_url:
url: http://cdk-builds.usersys.redhat.com/builds/nightly/latest-build/{{ foo_result1.stdout_lines[0] }}
dest: 'C:\Users\cdk\XYZ\rhel-vagrant-hyperv-new.box'
force: yes
when: ansible_distribution == 'Microsoft Windows NT 10.0.10586.0'
# with_items: "{{ foo_result1.stdout_lines }}"
# ignore_errors: yes
- win_unzip:
src: C:\Users\cdk\XYZ\cdk_automation.zip
dest: C:\Users\cdk\XYZ\cdk_automation
rm: true
when: ansible_distribution == 'Microsoft Windows NT 10.0.10586.0'
- raw:
vagrant plugin install vagrant-service-manager
chdir=~/cdk_automation/plugins
when: ansible_distribution == 'Microsoft Windows NT 10.0.10586.0'
- raw:
vagrant plugin install vagrant-registration
chdir=~/cdk_automation/plugins
when: ansible_distribution == 'Microsoft Windows NT 10.0.10586.0'
- raw:
vagrant plugin install vagrant-sshfs
chdir=~/cdk_automation/plugins
when: ansible_distribution == 'Microsoft Windows NT 10.0.10586.0'
- raw:
vagrant box add cdkv2 C:\Users\cdk\XYZ\rhel-vagrant-hyperv-new.box
ignore_errors: yes
# chdir=C:\Users\cdk\XYZ
when: ansible_distribution == 'Microsoft Windows NT 10.0.10586.0'