Chocolatey server role

This commit is contained in:
abrown38 committed 2024-04-12 13:13:46 +00:00
1 parent 265f582bdf
commit 3027c3dd76
6 files changed
+150

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
---
- hosts: "meta-variant_chocolatey_server"
gather_facts: false
vars_files:
- ../vars/common.yml
- ../vars/connection.yml
roles:
- role: win_chocolatey
tags: win_chocolatey
@@ -0,0 +1,55 @@
---
- name: Chocolatey Server
tags: choco_server
block:
- name: Set up chocolatey server
import_role:
name: jborean93.win_chocolatey_server
- name: Chocolatey Packages
tags:
- all_packages
block:
- name: Community Pacakges
tags: community_packages
block:
- name: Download base software packages to Chocolatey server.
win_get_url:
url: "https://community.chocolatey.org/api/v2/package/{{ package.name }}/{{ package.version }}"
dest: "{{ choco_package_path }}\\{{ package.name }}.{{ package.version }}.nupkg"
loop: "{{ community_packages }}"
loop_control:
loop_var: package
- name: Custom Packages
tags:
- custom_packages
block:
- name: Get list of local packages
vars:
ansible_connection: local
find:
paths: "{{ local_package_path }}"
file_type: file
patterns: "*.nupkg"
delegate_to: localhost
register: local_packages
- name: Copy custom packaged software to Chocolatey server.
win_copy:
src: "{{ package.path }}"
dest: "{{ choco_package_path }}\\"
#\\{{ package.path | basename | split('.') | first }}\\"
loop: "{{ local_packages.files }}"
loop_control:
loop_var: package
# taken from jborean93.win_chocolatey_server handler and modified with longer timeout
- name: open package page to get Chocolatey server to load nuget packages
win_uri:
url: http://localhost:{{ opt_chocolatey_server_http_port }}/chocolatey/Packages
user: '{{ pri_chocolatey_server_username|default(omit) }}'
password: '{{ pri_chocolatey_server_password|default(omit) }}'
url_timeout: 600
tags: refresh_packages
@@ -0,0 +1,20 @@
---
- name: Chocolatey Disk
tags: choco_disk
block:
- name: Initialise chocolatey disk
win_initialize_disk:
disk_number: 1
- name: Format/Partition disk
win_partition:
drive_letter: "{{ choco_drive_letter }}"
disk_number: 1
partition_size: -1
state: present
- name: Create NTFS filesystem and label it
win_format:
drive_letter: "{{ choco_drive_letter }}"
file_system: NTFS
new_label: Chocolatey
@@ -0,0 +1,4 @@
---
- import_tasks: disk.yml
#- import_tasks: setup.yml
- import_tasks: chocolatey.yml
@@ -0,0 +1,25 @@
---
- name: Features
tags: choco_features
block:
- name: Install IIS and management tools # can maybe be skipped (imported role already does this)
win_feature:
name:
- Web-WebServer
- Web-Scripting-Tools
state: present
include_management_tools: yes
include_sub_features: yes
register: feature_status
- name: Install .Net framework (4.5.2 minimum requirement for choco GUI)
ansible.windows.win_optional_feature:
name: NetFx4
state: present
register: opt_feature_status
- name: Rebooting Servers post feature installation
win_reboot:
reboot_timeout_sec: 1200
when: feature_status.reboot_required == true or
opt_feature_status.reboot_required == true
@@ -0,0 +1,37 @@
choco_drive_letter: R
opt_chocolatey_server_http_port: 80
opt_chocolatey_server_path: R:\tools\
choco_package_path: R:\tools\chocolatey.server\App_Data\Packages
local_package_path: /choco/packages/
community_packages:
- { name: 'vscode.install', version: '1.83.1' }
- { name: 'vscode', version: '1.83.1' }
- { name: 'chocolatey-windowsupdate.extension', version: '1.0.5' }
- { name: 'KB4019990', version: '1.0.2' }
- { name: 'KB2919442', version: '1.0.20160915' }
- { name: 'KB2919355', version: '1.0.20160915' }
- { name: 'KB2999226', version: '1.0.20181019' }
- { name: 'KB3033929', version: '1.0.5' }
- { name: 'KB3035131', version: '1.0.3' }
- { name: 'firefox', version: '116.0.2' }
- { name: 'office365proplus', version: '15330.20231' }
- { name: 'r.studio', version: '2023.6.1' }
- { name: 'notepadplusplus.install', version: '8.6.2' }
- { name: 'notepadplusplus', version: '8.6.2' }
- { name: 'windirstat', version: '1.1.2.20161210' }
- { name: 'adobereader', version: '2023.3.20269' }
- { name: 'vcredist140', version: '14.38.33135' }
- { name: 'vcredist2015', version: '14.0.24215.20170201' }
- { name: 'python312', version: '3.12.0' }
- { name: 'DotNet4.6', version: '4.6.00081.20150925' }
- { name: 'dotnet4.7.2', version: '4.7.2.20180712' }
- { name: 'chocolatey.server', version: '0.3.0' }
- { name: 'chocolatey-dotnetfx.extension', version: '1.0.1' }
- { name: 'ChocolateyGUI', version: '2.1.0' }
- { name: 'chocolatey-core.extension', version: '1.4.0' }
- { name: 'dotnetfx', version: '4.8.0.20220524' }
- { name: 'Chocolatey', version: '2.2.2' }
- { name: 'chocolatey-compatibility.extension', version: '1.0.0' }
- { name: 'R.Project', version: '4.3.1' }
- { name: 'veeam-agent', version: '6.1.0.350' }