From 439f98005f9bd02630f84c96b0b991fcd8a4a21e Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Thu, 15 Dec 2016 19:34:20 +0100 Subject: [PATCH] Highly rewrite and fix the examples - windows/win_iis_webbinding.py (#18823) --- .../modules/windows/win_iis_webbinding.py | 73 ++++++++----------- 1 file changed, 31 insertions(+), 42 deletions(-) diff --git a/lib/ansible/modules/windows/win_iis_webbinding.py b/lib/ansible/modules/windows/win_iis_webbinding.py index c7a08628f48..7ee3f7162d3 100644 --- a/lib/ansible/modules/windows/win_iis_webbinding.py +++ b/lib/ansible/modules/windows/win_iis_webbinding.py @@ -86,56 +86,45 @@ author: Henrik Wallström ''' 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 +- name: Return binding information for an existing host + win_iis_webbinding: + name: Default Web Site -# 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 +- name: Return the HTTPS binding information for an existing host + win_iis_webbinding: + name: Default Web Site + protocol: https -# This will add a HTTPS binding -$ ansible -i vagrant-inventory -m win_iis_webbinding -a "name='Default Web Site' protocol=https state=present" windows +- name: Add a HTTP binding on port 9090 + win_iis_webbinding: + name: Default Web Site + port: 9090 + state: present -# 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 +- name: Remove the HTTP binding on port 9090 + win_iis_webbinding: + name: Default Web Site + port: 9090 + state: absent +- name: Add a HTTPS binding + win_iis_webbinding: + name: Default Web Site + protocol: https + state: present -# Playbook example ---- +- name: Add a HTTPS binding and select certificate to use + win_iis_webbinding: + name: Default Web Site + protocol: https + certificate_hash: B0D0FA8408FC67B230338FCA584D03792DA73F4C + state: present -- name: Website http/https bidings +- name: Website https biding to specific port win_iis_webbinding: - name: "Default Web Site" + name: Default Web Site protocol: https port: 443 - certificate_hash: "D1A3AF8988FD32D1A3AF8988FD323792DA73F4C" + certificate_hash: D1A3AF8988FD32D1A3AF8988FD323792DA73F4C state: present - when: monitor_use_https - '''