community.windows icon indicating copy to clipboard operation
community.windows copied to clipboard

win_iis_website does change the website when parameters are different

Open jori-be opened this issue 3 years ago • 3 comments

SUMMARY

Environment:

  • Ansible 2.9
  • Windows Server 2019

I use the module win_iis_website to configure website on Windows IIS service. I've noticed that I'm not able to update the different parameters in case the website already exists. I've verified the following parameters:

  • hostname
  • port
ISSUE TYPE
  • Feature Idea
COMPONENT NAME

win_iis_website

ADDITIONAL INFORMATION

For example, I create a website which is linked to DNS CNAME which is configured in hostname. app.mywebsite.be When I update the hostname to different dns zone app.yourwebsite.be the hostname field is not updated in IIS. You see the same problem when you want to update the port.

  win_iis_website:
    name: '{{ package.name }}'
    state: started
    port: 80
    hostname: '{{ package.web_app.endpoint }}'
    application_pool: '{{ package.web_app.applicationpool.name }}'
    physical_path: '{{ iis.wwwroot }}\{{ package.name }}'

jori-be avatar Nov 04 '20 15:11 jori-be

Forgive me if I've misunderstood, but aren't these settings better suited for management by the win_iis_webbinding module which already can define the binding information?

mwtrigg avatar Nov 04 '20 16:11 mwtrigg

Hi @mwtrigg ,

That module could be used to add/delete bindings to IIS. However that module does not support adding bindings on hostnames (only IP bindings) and it is not possible to update bindings. If updates are needed, the module needs to be deleted and new binding needs to be added.

So what I'm looking for is something to create hostname bindings, neither win_iis_website and win_iis_webbinding do not support that.

Thanks for feedback.

jori-be avatar Nov 09 '20 13:11 jori-be

This just caught me out going live with a site (switching hostname from test to production domain): Even worse the https:// was working (because I had a separate win_iis_webbinding for https), but the http:// all suddenly went 404 (and left me with a bunch of bindings to the test domain which need manual clean up).

I feel like this is awkward enough that win_iis_website should either handle it, or make the user explicitly create the win_iis_webbinding. Thoughts?

davetapley avatar May 13 '21 17:05 davetapley