# Create IIS website with https binding only

**URL:** <https://forum.ansible.com/t/create-iis-website-with-https-binding-only/28539>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [September 10, 2018, 1:50pm UTC](https://forum.ansible.com/t/create-iis-website-with-https-binding-only/28539 "2018-09-10T13:50:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andriy\_Bilous\_ko](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Andriy\_Bilous\_ko](https://forum.ansible.com/u/Andriy_Bilous_ko)\
**Post date:** [September 10, 2018, 1:50pm UTC](https://forum.ansible.com/t/create-iis-website-with-https-binding-only/28539/1 "2018-09-10T13:50:57Z")

</div>

Hi,

**Ansible 2.6.3**

**Target hosts** : Windows

Guys, could you please tell me if we have possibility to create IIS website using **win\_iis\_website** module with HTTPS binding **only** (without HTTP one) ?

Like I can do this using Powershell (assuming application pool “test” already exists):

New-Website -Name “test” -PhysicalPath “Path\_to\_site\_folder” -Port 443 -ApplicationPool “test” -Ssl

I’ve used next task, but execution failed (assuming application pool “test” already exists):

- name: Create site  
win\_iis\_website:  
name: “test”  
physical\_path: ‘Path\_to\_site\_folder’  
port: 443  
ssl:  
application\_pool: “test”  
state: started

**win\_iis\_website** module offers parameter called **ssl** , but seems like it’s only mentioned among parameters [there](https://github.com/ansible/ansible/blob/stable-2.6/lib/ansible/modules/windows/win_iis_website.ps1) without actual usage during module execution.

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [September 10, 2018, 1:57pm UTC](https://forum.ansible.com/t/create-iis-website-with-https-binding-only/28539/2 "2018-09-10T13:57:03Z")

</div>

Tell us how it failed - error messages etc…

---

<div class="post-metadata">

**Author:** ![Andriy\_Bilous\_ko](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Andriy\_Bilous\_ko](https://forum.ansible.com/u/Andriy_Bilous_ko)\
**Post date:** [September 10, 2018, 2:04pm UTC](https://forum.ansible.com/t/create-iis-website-with-https-binding-only/28539/3 "2018-09-10T14:04:56Z")

</div>

Actually, module is not failed, but created HTTP binding instead of HTTPS

- name: Create site  
win\_iis\_website:  
name: “test”  
physical\_path: ‘Path\_to\_site\_folder’  
port: 443  
ssl:  
application\_pool: “test”  
state: started

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [September 10, 2018, 7:31pm UTC](https://forum.ansible.com/t/create-iis-website-with-https-binding-only/28539/4 "2018-09-10T19:31:46Z")

</div>

Looks like the ssl parameter is a no-op, it is defined but never used [https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/windows/win\_iis\_website.ps1#L21](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/windows/win_iis_website.ps1#L21). You can use the win\_iis\_webbinding [https://docs.ansible.com/ansible/latest/modules/win\_iis\_webbinding\_module.html](https://docs.ansible.com/ansible/latest/modules/win_iis_webbinding_module.html) or win\_dsc module with the xWebsite resource instead. An example of how to use DSC can be found here [https://docs.ansible.com/ansible/latest/user\_guide/windows\_dsc.html#setup-iis-website](https://docs.ansible.com/ansible/latest/user_guide/windows_dsc.html#setup-iis-website).

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Andriy\_Bilous\_ko](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Andriy\_Bilous\_ko](https://forum.ansible.com/u/Andriy_Bilous_ko)\
**Post date:** [September 11, 2018, 6:32pm UTC](https://forum.ansible.com/t/create-iis-website-with-https-binding-only/28539/5 "2018-09-11T18:32:56Z")

</div>

Totally forgot about DSC (and win\_dsc).

Thanks a lot, Jordan
