时间:2023-07-28 15:15:02 | 来源:网站运营
时间:2023-07-28 15:15:02 来源:网站运营
saltstack模块之win_iis(iis站点管理):#! https://zhuanlan.zhihu.com/p/538189864此函数仅针对站点名称进行验证,甚至会返回 True如果该站点已经存在并具有不同的配置。不会修改现有站点的配置。
:param str name: The IIS site name. IIS 站点名称。 :param str sourcepath: The physical path of the IIS site. IIS 站点的物理路径。 :param str apppool: The name of the IIS application pool. IIS 应用程序池的名称。 :param str hostheader: The host header of the binding. 绑定的主机头。 :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. 绑定的应用协议。
如果指定了应用程序池,并且该应用程序池尚不存在,它将被创建。
这将默认使用默认应用程序池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
此函数仅针对绑定 ipaddress:port:hostheader 组合进行验证,即使绑定已经存在不同的配置,也会返回 True 。它不会修改现有绑定的配置。
:site:IIS 站点名称。 :hostheader:绑定的主机头。 :ipaddress:绑定的IP地址。 :port:绑定的 TCP 端口。 :protocol:绑定的应用协议。 :sslflags:代表证书类型和绑定存储的标志。
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 站点名称。 : hostheader:绑定的主机头。 : 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
证书分配到的 Web 绑定必须已经存在。
:param str name:证书的指纹。 :param str site:IIS 站点名称。 :param str hostheader:绑定的主机头。 :param str ipaddress:绑定的IP地址。 :param str port:绑定的 TCP 端口。 :param str sslflags:代表证书类型和绑定证书存储的标志。
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
此函数仅从 Web 绑定中删除证书。它确实不删除网络绑定本身。
:param str name:证书的指纹。 :param str site:IIS 站点名称。 :param str hostheader:绑定的主机头。 :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
此函数仅针对应用程序池名称进行验证,并将返回即使应用程序池已经存在但具有不同的配置也是如此。它不会修改现有应用程序池的配置。
:param str name:IIS 应用程序池的名称。
site0-apppool: win_iis.create_apppool: - name: site0
:param str name:IIS 应用程序池的名称。
defaultapppool-remove: win_iis.remove_apppool: - name: DefaultAppPool
:param str name:IIS 容器的名称。:param str container: IIS 容器的类型。 容器类型是:AppPools, Sites, SslBindings:param str settings: 设置名称及其值的字典.
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
此函数仅针对应用程序名称进行验证,并将返回 True 即使应用程序已经存在不同的配置。 它不会修改现有应用程序的配置。
:param str 名称:IIS 应用程序。 :param str site:IIS 站点名称。 :param str sourcepath:物理路径。 :param str apppool:IIS 应用程序池的名称。
.. 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:应用程序名称。 :param str site:IIS 站点名称。
site0-v1-app-remove: win_iis.remove_app: - name: v1 - site: site0
此函数仅验证虚拟目录名称,并将返回 即使虚拟目录已经存在但具有不同的配置也是如此。 它不会修改现有虚拟目录的配置。
:param str name:虚拟目录名称。 :param str site:IIS 站点名称。 :param str sourcepath:物理路径。 :param str app:IIS 应用程序。
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 站点名称。 :param str app:IIS 应用程序。
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
此功能仅配置现有应用程序。参数区分大小写。
:param str 名称:IIS 应用程序。 :param str site:IIS 站点名称。 :param str settings:设置名称及其值的字典。
- ``physicalPath`` - webapp 的物理路径 - ``applicationPool`` - webapp 的应用程序池 - ``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: 包含设置的 IIS PSPath 的名称。可能的 PSPath 是: MACHINE, MACHINE/WEBROOT, IIS:/, IIS:/Sites/sitename, ... :param dict settings: Dictionaries of dictionaries. 您可以使用键内的以下语法匹配集合中的特定项目: '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 创作并发布
关键词:管理