{"id":29084930,"url":"https://github.com/workleap/ansible-role-azure-devops-agent","last_synced_at":"2025-06-27T22:11:48.739Z","repository":{"id":39373514,"uuid":"160591442","full_name":"workleap/ansible-role-azure-devops-agent","owner":"workleap","description":"An Ansible role that installs and configures a Linux machine to be used as an Azure DevOps build or deployment agent.","archived":false,"fork":false,"pushed_at":"2025-02-17T16:20:38.000Z","size":88,"stargazers_count":61,"open_issues_count":31,"forks_count":72,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-06T03:54:38.942Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workleap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-05T23:27:47.000Z","updated_at":"2025-04-11T05:49:32.000Z","dependencies_parsed_at":"2025-02-16T23:25:23.390Z","dependency_job_id":"52626689-6877-4237-a8d9-5836c1d3bd77","html_url":"https://github.com/workleap/ansible-role-azure-devops-agent","commit_stats":null,"previous_names":["gsoft-inc/ansible-role-azure-devops-agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/workleap/ansible-role-azure-devops-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fansible-role-azure-devops-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fansible-role-azure-devops-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fansible-role-azure-devops-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fansible-role-azure-devops-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workleap","download_url":"https://codeload.github.com/workleap/ansible-role-azure-devops-agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fansible-role-azure-devops-agent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262341638,"owners_count":23296072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-27T22:11:46.969Z","updated_at":"2025-06-27T22:11:48.726Z","avatar_url":"https://github.com/workleap.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure DevOps Agent\n\nAn Ansible role that installs and configures a Linux machine to be used as an [Azure DevOps build or deployment agent](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops).\n\nSee [this blog post](https://medium.com/gsoft-tech/easily-configuring-an-azure-devops-agent-with-ansible-fb9cb0f98b73) for more detail.\n\n## Requirements\n\n[See prerequisites](https://github.com/Microsoft/azure-pipelines-agent/blob/master/docs/start/envlinux.md)\n\nInstalling on MacOS can be problematic when trying to use an admin user for connecting and another user for running the service.\npipelining = True can help, especially if you run into issues where the devops agent user cannot access the temporary files ansible is creating.\n\n## Role Variables\n\nAvailable variables are listed below, along with default values (see `defaults/main.yml`):\n\n```yaml\n    az_devops_accountname: null\n    az_devops_accesstoken: null\n    az_devops_project_name: null\n    az_devops_agent_version: 2.188.3\n    az_devops_agent_user: \"az_devops_agent\"\n    az_devops_agent_uid: null\n    az_devops_agent_name: \"{{ ansible_hostname }}\"\n    az_devops_server_url: \"https://dev.azure.com/{{ az_devops_accountname }}\"\n    az_devops_agent_folder: \"/home/{{ az_devops_agent_user }}/agent/\"\n    az_devops_work_folder: \"/home/{{ az_devops_agent_user }}/agent/_work\"\n    az_devops_agent_pool_name: \"Default\"\n    az_devops_agent_role: \"build\"\n    az_devops_deployment_group_tags: null\n    az_devops_environment_name: null\n    az_devops_deployment_group_name: null\n    az_devops_agent_replace_existing: false\n    az_devops_reconfigure_agent: false\n    az_devops_agent_user_capabilities: null\n    az_devops_proxy_url: null\n    az_devops_proxy_username: null\n    az_devops_proxy_password: null\n```\n\n- **az_devops_accountname**\n\n  The name of your Azure DevOps account, i.e. https://dev.azure.com/YOUR_ACCOUNT_NAME\n\n- **az_devops_accesstoken**\n\n  The Personal Access Token (PAT) used to authenticate to your account. [See here for details on how to generate this value](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=vsts#authenticate-with-a-personal-access-token-pat).\n\n  _Note: Think about using Ansible Vault to secure this value._\n\n- **az_devops_project_name**\n\n  The name of the Azure DevOps project in which to register the agent (only used for deployment groups).\n\n- **az_devops_agent_version**\n\n  Version of the installed agent package. Should be periodically updated to the latest version (see [here](https://github.com/microsoft/azure-pipelines-agent/releases/latest)).\n\n- **az_devops_agent_user**\n\n  Name of the user used to run and configure the service.\n\n- **az_devops_agent_uid**\n\n  UID of the user used to run and configure the service.\n\n- **az_devops_agent_group**\n\n  Default group of the user used to run and configure the service.\n\n- **az_devops_agent_name**\n\n  Name of the agent shown in Azure DevOps (defaults to the name of the host.).\n\n- **az_devops_server_url**\n\n  Url for your Azure DevOps account.\n\n- **az_devops_agent_folder**\n\n  Folder location for all the agent specific files (note: important that the service user needs execution permissions on all the files in this folder).\n\n- **az_devops_work_folder**\n\n  Folder location for all the work specific files (i.e. pulled source code and build results).\n\n- **az_devops_agent_pool_name**\n\n  Pool name in which the Azure DevOps agent is added.\n\n- **az_devops_agent_role**\n\n  Use either `build`, `deployment` or `resource`. Build role allows the use of the agent as a build server in pipeline build or releases. Deployment role allows the use of the agent in a deployment group. Resource role allows the use of the agent as a virtual machine resource that can be targeted by deployments from a pipeline and belongs to an environment.\n\n- **az_devops_deployment_group_tags**\n\n  Use in conjuction with the `deployment` agent role. Allows the use of tags to identify the agent (ex: QA, Staging, Prod, etc.)\n\n- **az_devops_deployment_group_name**\n\n  Use in conjuction with the `deployment` agent role. The name of the deployment group in which to add the agent.  **This needs to be manually created in you Azure DevOps project beforehand.**\n\n- **az_devops_environment_name**\n\n  Use in conjuction with the `resource` agent role. The name of the environment in which to add the VM resource.  **This needs to be manually created in you Azure DevOps project beforehand.**\n\n- **az_devops_agent_replace_existing**\n\n  Adds the `--replace` argument to the configuration script for the [scenario where you need to replace an exiting agent with a new host](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops#pool-and-agent-names).\n\n- **az_devops_reconfigure_agent**\n\n  Forces a reconfiguration of the agent even if the service is already active\n\n- **az_devops_proxy_url**\n\n  The URL of the proxy server, format is `http://url:port`\n\n  This assumes the proxy does both http and https\n\n- **az_devops_proxy_username**\n\n  Username for the proxy\n\n  If the proxy does not require authentication, then just leave defaults\n\n- **az_devops_proxy_password**\n\n  Password for the proxy\n\n  Again if proxy does not require authentication, just leave the defaults.\n\n  _Note: Think about using Ansible Vault to secure this value._\n\n- **az_devops_agent_user_capabilties**\n\n  A Dictionary of environment variables to set for the agent process which translate to User Capabilties which can be helpful for setting [release pipeline demands](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/demands?view=azure-devops\u0026tabs=yaml)\n\n  Example usage:\n\n```yaml\n    - az_devops_agent_user_capabilties:\n      user_capabilty_key: user_capability_value\n```\n\n## Example Playbooks\n\n### Build Agent\n\n```yaml\n- hosts: agents\n  roles:\n      - gsoft.azure_devops_agent\n  vars:\n    - az_devops_agent_role: build\n    - az_devops_accountname: fubar\n    - az_devops_accesstoken: ***\n```\n\n### Deployment Agent\n\n```yaml\n- hosts: agents\n  roles:\n      - gsoft.azure_devops_agent\n  vars:\n    - az_devops_agent_role: deployment\n    - az_devops_accountname: fubar\n    - az_devops_accesstoken: ***\n    - az_devops_project_name: baz\n    - az_devops_deployment_group_name: fubar_group\n    - az_devops_deployment_group_tags: \"web,prod\"\n```\n\n### Resource\n\n```yaml\n- hosts: agents\n  roles:\n      - gsoft.azure_devops_agent\n  vars:\n    - az_devops_agent_role: resource\n    - az_devops_accountname: fubar\n    - az_devops_accesstoken: ***\n    - az_devops_project_name: baz\n    - az_devops_environment_name: staging\n```\n\n### Proxy\n\n```yaml\n- hosts: agents\n  roles:\n      - gsoft.azure_devops_agent\n  vars:\n    - az_devops_agent_role: build\n    - az_devops_accountname: fubar\n    - az_devops_accesstoken: ***\n    - az_devops_proxy_url: \"http://127.0.0.1:8080\"\n    - az_devops_proxy_username: bob\n    - az_devops_proxy_password: ***\n```\n\n## License\n\nCopyright © 2020, GSoft inc. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/gsoft-inc/gsoft-license/blob/master/LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkleap%2Fansible-role-azure-devops-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkleap%2Fansible-role-azure-devops-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkleap%2Fansible-role-azure-devops-agent/lists"}