mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-11-03 09:40:15 +00:00
Chocolatey server role
This commit is contained in:
1 parent
265f582bdf
commit
3027c3dd76
6 files changed
+150
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user