gsoft-inc / ansible-role-azure-devops-agent

An Ansible role that installs and configures a Linux machine to be used as an Azure DevOps build or deployment agent.
60 stars 72 forks source link

Make role work on multiple platforms #38

Closed rockdreamer closed 4 years ago

rockdreamer commented 4 years ago

Hi, as part of my work as 'DevOps guy' at CCDC, I've been asked to provision the vsts agent on multiple operating systems. This required adding support for macos and windows. (hence #37) Given we use ubuntu 20.04 vms, we also needed a solution for #20

I thus decided to avoid using the installdependencies.sh script and used the ansible package module.

To decide what packages to install, I used a technique we've used successfully in other occasions, which is to load defaults variables based on Distribution, Distribution family, operating system, adding in version specific details. This creates a bit of file churn but makes it very easy to add a different distribution.

For windows, I found it easier to use chocolatey to install the agent, reducing a lot of the complexity in downloading and extracting the files.

I tested the changes using vagrant on:

Screenshot 2020-10-16 at 11 48 20
yohanb commented 4 years ago

Great stuff, thanks for the contribution.