Documentation

win_iis_webbinding - Configures a IIS Web site.

New in version 2.0.

Synopsis

Creates, Removes and configures a binding to an existing IIS Web site

Options

parameter required default choices comments
certificate_hash
no
    Certificate hash for the SSL binding. The certificate hash is the unique identifier for the certificate.
    certificate_store_name
    no My
      Name of the certificate store where the certificate for the binding is located.
      host_header
      no
        The host header to bind to / use for the new site.
        ip
        no
          The IP address to bind to / use for the new site.
          name
          yes
            Names of web site
            port
            no
              The port to bind to / use for the new site.
              protocol
              no
                The protocol to be used for the Web binding (usually HTTP, HTTPS, or FTP).
                state
                no
                • present
                • absent
                State of the binding

                Examples

                # This will return binding information for an existing host
                $ ansible -i vagrant-inventory -m win_iis_webbinding -a "name='Default Web Site'" windows
                host | success >> {
                    "added": [],
                    "changed": false,
                    "matched": [
                        {
                            "bindingInformation": "*:80:",
                            "certificateHash": "",
                            "certificateStoreName": "",
                            "isDsMapperEnabled": false,
                            "protocol": "http",
                            "sslFlags": 0
                        }
                    ],
                    "parameters": {
                        "Name": "Default Web Site"
                    },
                    "removed": []
                }
                
                # This will return the HTTPS binding information for an existing host
                $ ansible -i vagrant-inventory -m win_iis_webbinding -a "name='Default Web Site' protocol=https" windows
                
                # This will return the HTTPS binding information for an existing host
                $ ansible -i vagrant-inventory -m win_iis_webbinding -a "name='Default Web Site' port:9090 state=present" windows
                
                # This will add a HTTP binding on port 9090
                $ ansible -i vagrant-inventory -m win_iis_webbinding -a "name='Default Web Site' port=9090 state=present" windows
                
                # This will remove the HTTP binding on port 9090
                $ ansible -i vagrant-inventory -m win_iis_webbinding -a "name='Default Web Site' port=9090 state=present" windows
                
                # This will add a HTTPS binding
                $ ansible -i vagrant-inventory -m win_iis_webbinding -a "name='Default Web Site' protocol=https state=present" windows
                
                # This will add a HTTPS binding and select certificate to use
                # ansible -i vagrant-inventory -m win_iis_webbinding -a "name='Default Web Site' protocol=https certificate_hash= B0D0FA8408FC67B230338FCA584D03792DA73F4C" windows
                
                
                # Playbook example
                ---
                
                - name: Website http/https bidings
                  win_iis_webbinding:
                    name: "Default Web Site"
                    protocol: https
                    port: 443
                    certificate_hash: "D1A3AF8988FD32D1A3AF8988FD323792DA73F4C"
                    state: present
                  when: monitor_use_https
                

                This is an Extras Module

                For more information on what this means please read Extras Modules

                For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.