時(shí)間:2023-07-28 15:15:02 | 來(lái)源:網(wǎng)站運(yùn)營(yíng)
時(shí)間:2023-07-28 15:15:02 來(lái)源:網(wǎng)站運(yùn)營(yíng)
saltstack模塊之win_iis(iis站點(diǎn)管理):#! https://zhuanlan.zhihu.com/p/538189864此函數(shù)僅針對(duì)站點(diǎn)名稱進(jìn)行驗(yàn)證,甚至?xí)祷?True如果該站點(diǎn)已經(jīng)存在并具有不同的配置。不會(huì)修改現(xiàn)有站點(diǎn)的配置。
:param str name: The IIS site name. IIS 站點(diǎn)名稱。 :param str sourcepath: The physical path of the IIS site. IIS 站點(diǎn)的物理路徑。 :param str apppool: The name of the IIS application pool. IIS 應(yīng)用程序池的名稱。 :param str hostheader: The host header of the binding. 綁定的主機(jī)頭。 :param str ipaddress: The IP address of the binding. 綁定的 IP 地址。 :param str port: The TCP port of the binding. 綁定的 TCP 端口。 :param str protocol: The application protocol of the binding. 綁定的應(yīng)用協(xié)議。
如果指定了應(yīng)用程序池,并且該應(yīng)用程序池尚不存在,它將被創(chuàng)建。
這將默認(rèn)使用默認(rèn)應(yīng)用程序池assigned by IIS:
site0-deployed: win_iis.deployed: - name: site0 - sourcepath: C://inetpub//site0
site0-deployed: win_iis.deployed: - name: site0 - sourcepath: C://inetpub//site0 - apppool: site0 - hostheader: site0.local - ipaddress: '*' - port: 443 - protocol: https
defaultwebsite-remove: win_iis.remove_site: - name: Default Web Site
此函數(shù)僅針對(duì)綁定 ipaddress:port:hostheader 組合進(jìn)行驗(yàn)證,即使綁定已經(jīng)存在不同的配置,也會(huì)返回 True 。它不會(huì)修改現(xiàn)有綁定的配置。
:site:IIS 站點(diǎn)名稱。 :hostheader:綁定的主機(jī)頭。 :ipaddress:綁定的IP地址。 :port:綁定的 TCP 端口。 :protocol:綁定的應(yīng)用協(xié)議。 :sslflags:代表證書(shū)類型和綁定存儲(chǔ)的標(biāo)志。
site0-https-binding: win_iis.create_binding: - site: site0
site0-https-binding: win_iis.create_binding: - site: site0 - hostheader: site0.local - ipaddress: '*' - port: 443 - protocol: https - sslflags: 0
: site:IIS 站點(diǎn)名稱。 : hostheader:綁定的主機(jī)頭。 : ipaddress:綁定的IP地址。 : port:綁定的 TCP 端口。
site0-https-binding-remove: win_iis.remove_binding: - site: site0
site0-https-binding-remove: win_iis.remove_binding: - site: site0 - hostheader: site0.local - ipaddress: '*' - port: 443
證書(shū)分配到的 Web 綁定必須已經(jīng)存在。
:param str name:證書(shū)的指紋。 :param str site:IIS 站點(diǎn)名稱。 :param str hostheader:綁定的主機(jī)頭。 :param str ipaddress:綁定的IP地址。 :param str port:綁定的 TCP 端口。 :param str sslflags:代表證書(shū)類型和綁定證書(shū)存儲(chǔ)的標(biāo)志。
site0-cert-binding: win_iis.create_cert_binding: - name: 9988776655443322111000AAABBBCCCDDDEEEFFF - site: site0
site0-cert-binding: win_iis.create_cert_binding: - name: 9988776655443322111000AAABBBCCCDDDEEEFFF - site: site0 - hostheader: site0.local - ipaddress: 192.168.1.199 - port: 443 - sslflags: 1
此函數(shù)僅從 Web 綁定中刪除證書(shū)。它確實(shí)不刪除網(wǎng)絡(luò)綁定本身。
:param str name:證書(shū)的指紋。 :param str site:IIS 站點(diǎn)名稱。 :param str hostheader:綁定的主機(jī)頭。 :param str ipaddress:綁定的IP地址。 :param str port:綁定的 TCP 端口。
site0-cert-binding-remove: win_iis.remove_cert_binding: - name: 9988776655443322111000AAABBBCCCDDDEEEFFF - site: site0
site0-cert-binding-remove: win_iis.remove_cert_binding: - name: 9988776655443322111000AAABBBCCCDDDEEEFFF - site: site0 - hostheader: site0.local - ipaddress: 192.168.1.199 - port: 443
此函數(shù)僅針對(duì)應(yīng)用程序池名稱進(jìn)行驗(yàn)證,并將返回即使應(yīng)用程序池已經(jīng)存在但具有不同的配置也是如此。它不會(huì)修改現(xiàn)有應(yīng)用程序池的配置。
:param str name:IIS 應(yīng)用程序池的名稱。
site0-apppool: win_iis.create_apppool: - name: site0
:param str name:IIS 應(yīng)用程序池的名稱。
defaultapppool-remove: win_iis.remove_apppool: - name: DefaultAppPool
:param str name:IIS 容器的名稱。:param str container: IIS 容器的類型。 容器類型是:AppPools, Sites, SslBindings:param str settings: 設(shè)置名稱及其值的字典.
AppPools
容器的使用示例:site0-apppool-setting: win_iis.container_setting: - name: site0 - container: AppPools - settings: managedPipelineMode: Integrated processModel.maxProcesses: 1 processModel.userName: TestUser processModel.password: TestPassword processModel.identityType: SpecificUser
site0-site-setting: win_iis.container_setting: - name: site0 - container: Sites - settings: logFile.logFormat: W3C logFile.period: Daily limits.maxUrlSegments: 32
此函數(shù)僅針對(duì)應(yīng)用程序名稱進(jìn)行驗(yàn)證,并將返回 True 即使應(yīng)用程序已經(jīng)存在不同的配置。 它不會(huì)修改現(xiàn)有應(yīng)用程序的配置。
:param str 名稱:IIS 應(yīng)用程序。 :param str site:IIS 站點(diǎn)名稱。 :param str sourcepath:物理路徑。 :param str apppool:IIS 應(yīng)用程序池的名稱。
.. code-block:: yaml
site0-v1-app: win_iis.create_app: - name: v1 - site: site0 - sourcepath: C://inetpub//site0//v1
site0-v1-app: win_iis.create_app: - name: v1 - site: site0 - sourcepath: C://inetpub//site0//v1 - apppool: site0
:param str name:應(yīng)用程序名稱。 :param str site:IIS 站點(diǎn)名稱。
site0-v1-app-remove: win_iis.remove_app: - name: v1 - site: site0
此函數(shù)僅驗(yàn)證虛擬目錄名稱,并將返回 即使虛擬目錄已經(jīng)存在但具有不同的配置也是如此。 它不會(huì)修改現(xiàn)有虛擬目錄的配置。
:param str name:虛擬目錄名稱。 :param str site:IIS 站點(diǎn)名稱。 :param str sourcepath:物理路徑。 :param str app:IIS 應(yīng)用程序。
site0-foo-vdir: win_iis.create_vdir: - name: foo - site: site0 - sourcepath: C://inetpub//vdirs//foo
site0-foo-vdir: win_iis.create_vdir: - name: foo - site: site0 - sourcepath: C://inetpub//vdirs//foo - app: v1
:param str name:虛擬目錄名稱。 :param str site:IIS 站點(diǎn)名稱。 :param str app:IIS 應(yīng)用程序。
site0-foo-vdir-remove: win_iis.remove_vdir: - name: foo - site: site0
site0-foo-vdir-remove: win_iis.remove_vdir: - name: foo - site: site0 - app: v1
此功能僅配置現(xiàn)有應(yīng)用程序。參數(shù)區(qū)分大小寫(xiě)。
:param str 名稱:IIS 應(yīng)用程序。 :param str site:IIS 站點(diǎn)名稱。 :param str settings:設(shè)置名稱及其值的字典。
- ``physicalPath`` - webapp 的物理路徑 - ``applicationPool`` - webapp 的應(yīng)用程序池 - ``userName``“connectAs”用戶 - ``password`` "connectAs" 用戶密碼:rtype: bool
site0-webapp-setting: win_iis.set_app: - name: app0 - site: Default Web Site - settings: userName: domain//user password: pass physicalPath: c:/inetpub/wwwroot applicationPool: appPool0
:param str name: 包含設(shè)置的 IIS PSPath 的名稱??赡艿?PSPath 是: MACHINE, MACHINE/WEBROOT, IIS:/, IIS:/Sites/sitename, ... :param dict settings: Dictionaries of dictionaries. 您可以使用鍵內(nèi)的以下語(yǔ)法匹配集合中的特定項(xiàng)目: 'Collection[{name: site0}].logFile.directory'
MACHINE/WEBROOT
PSPath 的使用示例:MACHINE-WEBROOT-level-security: win_iis.webconfiguration_settings: - name: 'MACHINE/WEBROOT' - settings: system.web/authentication/forms: requireSSL: True protection: "All" credentials.passwordFormat: "SHA1" system.web/httpCookies: httpOnlyCookies: True
IIS:/Sites/site0
PSPath 的使用示例:site0-IIS-Sites-level-security: win_iis.webconfiguration_settings: - name: 'IIS:/Sites/site0' - settings: system.webServer/httpErrors: errorMode: "DetailedLocalOnly" system.webServer/security/requestFiltering: allowDoubleEscaping: False verbs.Collection: - verb: TRACE allowed: False fileExtensions.allowUnlisted: False
IIS:/
PSPath 的使用示例:site0-IIS-level-security: win_iis.webconfiguration_settings: - name: 'IIS:/' - settings: system.applicationHost/sites: 'Collection[{name: site0}].logFile.directory': 'C:/logs/iis/site0'
本文使用 Zhihu On VSCode 創(chuàng)作并發(fā)布
關(guān)鍵詞:管理
客戶&案例
營(yíng)銷資訊
關(guān)于我們
客戶&案例
營(yíng)銷資訊
關(guān)于我們
微信公眾號(hào)
版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。