Initial hyper-v demo skeleton
This commit is contained in:
43
playbooks/install-iis.yml
Normal file
43
playbooks/install-iis.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
- name: Install and configure IIS
|
||||
hosts: web_servers
|
||||
gather_facts: true
|
||||
|
||||
tasks:
|
||||
- name: Install IIS features
|
||||
ansible.windows.win_feature:
|
||||
name: "{{ iis_features }}"
|
||||
state: present
|
||||
register: iis_install
|
||||
|
||||
- name: Reboot if required
|
||||
ansible.windows.win_reboot:
|
||||
reboot_timeout: 3600
|
||||
when: iis_install.reboot_required
|
||||
|
||||
- name: Create demo web content
|
||||
ansible.windows.win_copy:
|
||||
content: |
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Demo IIS Site - {{ inventory_hostname }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to {{ inventory_hostname }}</h1>
|
||||
<p>This server was configured by Ansible Automation Platform</p>
|
||||
<p>Deployment Date: {{ ansible_date_time.iso8601 }}</p>
|
||||
</body>
|
||||
</html>
|
||||
dest: "{{ iis_website_path }}\\index.html"
|
||||
|
||||
- name: Ensure IIS service is running
|
||||
ansible.windows.win_service:
|
||||
name: W3SVC
|
||||
state: started
|
||||
start_mode: auto
|
||||
|
||||
- name: Update CMDB with IIS installation
|
||||
ansible.builtin.debug:
|
||||
msg: "Would update ServiceNow CMDB with IIS installation"
|
||||
# TODO: Implement ServiceNow CMDB update
|
||||
Reference in New Issue
Block a user