-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiissetup.yml
44 lines (38 loc) · 1.03 KB
/
iissetup.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
- name: IIS Setup
hosts: windows
tasks:
- name: create a folder to store IIS site
win_file:
path: C:\ansible
state: directory
- name: create a basic html page
win_copy:
content: |
<html>
<head><title>IIS Test</title></head>
<body>This is a webpage created by ansible!!</body>
</html>
dest: C:\ansible\index.html
- name: install the IIS features
win_feature:
name: Web-Server
state: present
include_sub_features: yes
include_management_tools: no
- name: remove the default IIS website
win_iis_website:
name: Default Web Site
state: absent
- name: create new IIS website
win_iis_website:
name: Ansible Demo
state: started
port: 8080
physical_path: C:\ansible
- name: Copy PowerShell script
win_copy:
src: /etc/ansible/scripts/iissetup.ps1
dest: 'C:\'
remote_src: no
- name: Execute PowerShell script
win_command: powershell.exe -ExecutionPolicy ByPass -File C:\iissetup.ps1