Skip to content

Instantly share code, notes, and snippets.

@andif888
Created October 27, 2021 10:18
Show Gist options
  • Save andif888/1d73d359e797190236504929b1a45241 to your computer and use it in GitHub Desktop.
Save andif888/1d73d359e797190236504929b1a45241 to your computer and use it in GitHub Desktop.
Ansible Citrix DC Setup
---
- hosts: windows_ctx_dc
vars_files:
- vars/generic.yml
roles:
- { role: ansible-role-win-dotnet48 }
tasks:
- name: ctx-dc - Windows Features
win_feature:
name: '{{ item.name }}'
state: present
with_items:
- { name: 'Web-Server' }
- { name: 'Web-Common-Http' }
- { name: 'Web-Default-Doc' }
- { name: 'Web-Dir-Browsing' }
- { name: 'Web-Http-Errors' }
- { name: 'Web-Static-Content' }
- { name: 'Web-Http-Redirect' }
- { name: 'Web-Health' }
- { name: 'Web-Http-Logging' }
- { name: 'Web-Log-Libraries' }
- { name: 'Web-Http-Tracing' }
- { name: 'Web-Stat-Compression' }
- { name: 'Web-Dyn-Compression' }
- { name: 'Web-Security' }
- { name: 'Web-Filtering' }
- { name: 'Web-Basic-Auth' }
- { name: 'Web-Windows-Auth' }
- { name: 'Web-App-Dev' }
- { name: 'Web-Net-Ext45' }
- { name: 'Web-AppInit' }
- { name: 'Web-ASP' }
- { name: 'Web-Asp-Net45' }
- { name: 'Web-CGI' }
- { name: 'Web-ISAPI-Ext' }
- { name: 'Web-ISAPI-Filter' }
- { name: 'Web-Includes' }
- { name: 'Web-Mgmt-Tools' }
- { name: 'Web-Mgmt-Console' }
- { name: 'Web-Mgmt-Compat' }
- { name: 'Web-Metabase' }
- { name: 'Web-Lgcy-Mgmt-Console' }
- { name: 'Web-Lgcy-Scripting' }
- { name: 'Web-WMI' }
- { name: 'Web-Scripting-Tools' }
- { name: 'NET-Framework-45-Features' }
- { name: 'NET-Framework-45-Core' }
- { name: 'NET-Framework-45-ASPNET' }
- { name: 'NET-WCF-Services45' }
- { name: 'NET-WCF-HTTP-Activation45' }
- { name: 'NET-WCF-TCP-PortSharing45' }
- name: ctx-dc - Download Citrix Virtual Apps and Desktops ISO
win_get_url:
url: '{{ citrix_vad_iso_url }}'
dest: 'C:\Windows\Temp\{{ citrix_vad_iso_file }}'
force: no
- name: ctx-dc - Mount Citrix Virtual Apps and Desktops ISO
win_disk_image:
image_path: 'C:\Windows\Temp\{{ citrix_vad_iso_file }}'
state: present
register: disk_image_out
- name: ctx-dc - sleep for 2 seconds and continue with play
wait_for:
timeout: 2
delegate_to: localhost
# mount_paths[] !!!
- name: ctx-dc - Install XenDesktopServer (ansible < 2.10)
win_package:
path: '{{ disk_image_out.mount_path }}x64\XenDesktop Setup\XenDesktopServerSetup.exe'
arguments: /components CONTROLLER,DESKTOPSTUDIO,DESKTOPDIRECTOR,LICENSESERVER /configure_firewall /disableexperiencemetrics /exclude "Local Host Cache Storage (LocalDB)" /nosql /quiet
product_id: '{62367AFF-7467-468D-B853-00133BF5F97F}'
state: present
register: ctx_dc_install
when: ansible_version.full is version_compare('2.10', '<')
- name: ctx-dc - Install XenDesktopServer (ansible >= 2.10)
win_package:
path: '{{ disk_image_out.mount_paths[0] }}x64\XenDesktop Setup\XenDesktopServerSetup.exe'
arguments: /components CONTROLLER,DESKTOPSTUDIO,DESKTOPDIRECTOR,LICENSESERVER /configure_firewall /disableexperiencemetrics /exclude "Local Host Cache Storage (LocalDB)" /nosql /quiet
product_id: '{62367AFF-7467-468D-B853-00133BF5F97F}'
state: present
register: ctx_dc_install
when: ansible_version.full is version_compare('2.10', '>=')
- name: ctx-dc - Umount Citrix Virtual Apps and Desktops ISO
win_disk_image:
image_path: 'C:\Windows\Temp\{{ citrix_vad_iso_file }}'
state: absent
- name: ctx-dc - reboot if required
win_reboot:
when:
- ctx_dc_install is defined
- ctx_dc_install.reboot_required|default(false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment