community.windows.win_iis_webapppool

该模块用来查看和启动停止和重启 windows IIS 的服务
example

  1. - name: Return information about an existing application pool
  2. community.windows.win_iis_webapppool:
  3. name: DefaultAppPool
  4. state: present
  5. - name: Create a new application pool in 'Started' state
  6. community.windows.win_iis_webapppool:
  7. name: AppPool
  8. state: started
  9. - name: Stop an application pool
  10. community.windows.win_iis_webapppool:
  11. name: AppPool
  12. state: stopped
  13. - name: Restart an application pool (non-idempotent)
  14. community.windows.win_iis_webapppool:
  15. name: AppPool
  16. state: restarted
  17. - name: Change application pool attributes using new dict style
  18. community.windows.win_iis_webapppool:
  19. name: AppPool
  20. attributes:
  21. managedRuntimeVersion: v4.0
  22. autoStart: no
  23. - name: Creates an application pool, sets attributes and starts it
  24. community.windows.win_iis_webapppool:
  25. name: AnotherAppPool
  26. state: started
  27. attributes:
  28. managedRuntimeVersion: v4.0
  29. autoStart: no
  30. # In the below example we are setting attributes in child element processModel
  31. # https://www.iis.net/configreference/system.applicationhost/applicationpools/add/processmodel
  32. - name: Manage child element and set identity of application pool
  33. community.windows.win_iis_webapppool:
  34. name: IdentitiyAppPool
  35. state: started
  36. attributes:
  37. managedPipelineMode: Classic
  38. processModel.identityType: SpecificUser
  39. processModel.userName: '{{ansible_user}}'
  40. processModel.password: '{{ansible_password}}'
  41. processModel.loadUserProfile: true
  42. - name: Manage a timespan attribute
  43. community.windows.win_iis_webapppool:
  44. name: TimespanAppPool
  45. state: started
  46. attributes:
  47. # Timespan with full string "day:hour:minute:second.millisecond"
  48. recycling.periodicRestart.time: "00:00:05:00.000000"
  49. recycling.periodicRestart.schedule: ["00:10:00", "05:30:00"]
  50. # Shortened timespan "hour:minute:second"
  51. processModel.pingResponseTime: "00:03:00"

ansible-console
win_iis_webapppool name= state=present