IIS Application Pool - Specific Identity

195 views
Skip to first unread message

DevOps Unleashed

unread,
Mar 19, 2017, 6:29:48 PM3/19/17
to Ansible Project
Is it possible to use Ansible to create a new IIS Application Pool that runs under a specific "identity"?

Cheers

J Hawkesworth

unread,
Mar 20, 2017, 12:27:20 PM3/20/17
to Ansible Project
Yes, but its two steps at the moment and the second step isn't idempotent.

Try something like this:

# create the app pool first

- name: Update/Create DefaultAppPool
  win_iis_webapppool:
    name: 'DefaultAppPool'
    state: started
    attributes: managedRuntimeVersion:v4.0|enable32BitAppOnWin64:true
  register: DefaultAppPool

# then switch to running as a (domain) user
- name: configure listed app pools to run as correct user
  win_command: 'C:\Windows\System32\inetsrv\appcmd.exe set config /section:applicationPools "/[name=''{{ item }}''].processModel.identityType:SpecificUser" "/[name=''{{ item }}''].processModel.userName:{{ fdomain }}\{{ user }}" "/[name=''{{ item }}''].processModel.password:{{ credential }}"'
  with_items:
   - DefaultAppPool
   - SomeOtherAppPool
Reply all
Reply to author
Forward
0 new messages