Repos with recipes to deploy some infrastructure services
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

101 lignes
3.7 KiB

  1. ---
  2. - name: Windows-Add or update registry path Dnscache, with dword entry 'Type', and containing 0x00000020 as the hex value
  3. win_regedit:
  4. path: HKLM:\SYSTEM\CurrentControlSet\services\Dnscache
  5. name: Type
  6. data: 0x00000020
  7. type: dword
  8. - name: Windows-Checking to see if Crowdstrike is already installed
  9. win_shell: |
  10. Get-Service -Name "CSFalconService"
  11. register: crowd_installed
  12. changed_when: false
  13. ignore_errors: true
  14. - name: Windows-Check if services are installed and running
  15. win_service:
  16. name: "{{ item }}"
  17. state: started
  18. with_items:
  19. - nsi
  20. - BFE
  21. - Power
  22. - lmhosts
  23. - WinHttpAutoProxySvc
  24. - Dhcp
  25. when: crowd_installed is failed
  26. - name: Windows-Disable IE enhanced security
  27. win_shell: 'Set-ItemProperty -Path "{{ Emplacement_Clef_Securite }}{{ item.Clef }}" -Name IsInstalled -Value 0'
  28. with_items:
  29. - { Clef: "{{ Clef_Securite_Admin }}" }
  30. - { Clef: "{{ Clef_Securite_Users }}" }
  31. vars:
  32. Emplacement_Clef_Securite: 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\'
  33. Clef_Securite_Admin: '{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}'
  34. Clef_Securite_Users: '{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}'
  35. when: crowd_installed is failed
  36. ignore_errors: yes #Keep ignore for non server OS
  37. - name: Windows-Add Windows Defender exclusions
  38. win_shell: Add-MpPreference -{{ item.ExclusionType }} "{{ item.valeur }}"
  39. with_items:
  40. - { ExclusionType: ExclusionPath, valeur: 'D:\' }
  41. - { ExclusionType: ExclusionPath, valeur: 'C:\ProgramData\' }
  42. - { ExclusionType: ExclusionPath, valeur: 'C:\Users\' }
  43. - { ExclusionType: ExclusionExtension, valeur: '.exe' }
  44. when: crowd_installed is failed
  45. - name: Instal Crowdstrike agent
  46. win_package:
  47. product_id: '{D339C288-2EEA-49A3-B10F-979FC2715A2C}'
  48. path: http://{{ katelloURL }}/pulp/isos/NeXT/Library/custom/Misc/Misc-zip-packages/{{ Crowdstrike_version_win }}
  49. arguments: /install /quiet /norestart CID={{ Crowdstrike_cid }} VDI=1
  50. state: present
  51. when: crowd_installed is failed
  52. register: result
  53. retries: 1
  54. until: result is succeeded
  55. delay: 15
  56. - name: Windows-Add or update registry with binary entry
  57. win_regedit:
  58. path: 'HKLM:\SYSTEM\CrowdStrike\{9b03c1d9-3138-44ed-9fae-d9f4c034b88d}\{16e0423f-7058-48c9-a204-725362b67639}'
  59. name: Default
  60. data: [0x03,0x00,0x00,0x00]
  61. type: binary
  62. when: crowd_installed is failed
  63. - name: Windows-Check if CSFalconService is running
  64. win_service:
  65. name: CSFalconService
  66. state: started
  67. when: crowd_installed is failed
  68. - name: Windows-Check Crowdstrike obtained ID else fail
  69. win_shell: '.\CSDeviceControlSupportTool.exe {{ Crowdstrike_cid }} -c showrules'
  70. args:
  71. chdir: 'C:\Program Files\CrowdStrike'
  72. register: crowd_result
  73. failed_when: "'Failed' in crowd_result.stdout"
  74. retries: 6
  75. until: crowd_result is succeeded
  76. delay: 30
  77. when: crowd_installed is failed
  78. - name: 'Windows-Windows defender Exclusions cleanup'
  79. win_shell: "{{ item.Command }}"
  80. with_items:
  81. - { Command: '( Get-MpPreference ).ExclusionPath | foreach { Remove-MpPreference -ExclusionPath $_.ToString()}' }
  82. - { Command: '( Get-MpPreference ).ExclusionProcess | foreach { Remove-MpPreference -ExclusionProcess $_.ToString()}' }
  83. when: crowd_installed is failed
  84. - name: 'Windows-Enable IE enhanced security'
  85. win_shell: 'Set-ItemProperty -Path "{{ Emplacement_Clef_Securite }}{{ item.Clef }}" -Name IsInstalled -Value 1'
  86. with_items:
  87. - { Clef: "{{ Clef_Securite_Admin }}" }
  88. - { Clef: "{{ Clef_Securite_Users }}" }
  89. when: crowd_installed is failed
  90. ignore_errors: yes #Keep ignore for non server OS