Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
az_devops_agent_version: 2.188.3
az_devops_agent_version: 3.241.0
az_devops_agent_user: "az_devops_agent"
az_devops_agent_name: "{{ ansible_hostname }}"
az_devops_server_url: "https://dev.azure.com/{{ az_devops_accountname }}/"
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ galaxy_info:
- name: EL
versions:
- 7
- 9
- name: Debian
versions:
- stretch
Expand Down
19 changes: 10 additions & 9 deletions tasks/Darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,18 @@

- name: Add deployment group tags
set_fact:
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args }} +
['--addDeploymentGroupTags', '--deploymentGroupTags \\'{{ az_devops_deployment_group_tags }}\\'']"
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args +
['--addDeploymentGroupTags', '--deploymentGroupTags', '\"' +
az_devops_deployment_group_tags +
'\"'] }}"
when:
- az_devops_deployment_group_tags is defined
- az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags is not none

- name: Set proxy
set_fact:
agent_cmd_args: "{{ agent_cmd_args }} + ['--proxyurl \\'{{ az_devops_proxy_url }}\\'',
'--proxyusername \\'{{ az_devops_proxy_username }}\\'', '--proxypassword \\'{{ az_devops_proxy_password }}\\'']"
agent_cmd_args: "{{ agent_cmd_args + ['--proxyurl \\'{{ az_devops_proxy_url }}\\'', '--proxyusername \\'{{ az_devops_proxy_username }}\\'', '--proxypassword \\'{{ az_devops_proxy_password }}\\''] }}"
when:
- az_devops_proxy_url is defined
- az_devops_proxy_url is defined and az_devops_proxy_url

- name: Uninstall agent service
command: ./svc.sh uninstall
Expand All @@ -125,9 +126,9 @@

- name: Add '--replace' configuration argument
set_fact:
build_agent_cmd_args: "{{ build_agent_cmd_args }} + ['--replace']"
deployment_agent_cmd_args: "{{ build_agent_cmd_args }} + ['--replace']"
resource_agent_cmd_args: "{{ resource_agent_cmd_args }} + ['--replace']"
build_agent_cmd_args: "{{ build_agent_cmd_args + ['--replace'] }}"
deployment_agent_cmd_args: "{{ build_agent_cmd_args + ['--replace'] }}"
resource_agent_cmd_args: "{{ resource_agent_cmd_args + ['--replace'] }}"
when:
- az_devops_agent_replace_existing

Expand Down
39 changes: 25 additions & 14 deletions tasks/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
- "{{ az_devops_work_folder }}"
become: true

- name: Install dependencies
package:
name: "{{ az_devops_agent_dependencies }}"
state: present
become: true

- name: Check if svc.sh exists
stat:
path: "{{ '/'.join((az_devops_agent_folder, 'svc.sh')) }}"
Expand All @@ -51,6 +45,10 @@
changed_when: false
check_mode: no

# helpful for when agent installation had failed in the middle
- include_tasks: _task_install_dependencies.yml
when: bin_agent_listener.stat.exists

- name: Check agent version
command: ./bin/Agent.Listener --version
become: true
Expand Down Expand Up @@ -94,16 +92,18 @@

- name: Add deployment group tags
set_fact:
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args }} +
['--addDeploymentGroupTags', '--deploymentGroupTags \\'{{ az_devops_deployment_group_tags }}\\'']"
deployment_agent_cmd_args: "{{ deployment_agent_cmd_args +
['--addDeploymentGroupTags', '--deploymentGroupTags', '\"' +
az_devops_deployment_group_tags +
'\"'] }}"
when:
- az_devops_deployment_group_tags is defined
- az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags is not none

- name: Set proxy
set_fact:
agent_cmd_args: "{{ agent_cmd_args }} + ['--proxyurl \\'{{ az_devops_proxy_url }}\\'', '--proxyusername \\'{{ az_devops_proxy_username }}\\'', '--proxypassword \\'{{ az_devops_proxy_password }}\\'']"
agent_cmd_args: "{{ agent_cmd_args + ['--proxyurl \\'{{ az_devops_proxy_url }}\\'', '--proxyusername \\'{{ az_devops_proxy_username }}\\'', '--proxypassword \\'{{ az_devops_proxy_password }}\\''] }}"
when:
- az_devops_proxy_url is defined
- az_devops_proxy_url is defined and az_devops_proxy_url

- name: Download and unarchive
unarchive:
Expand Down Expand Up @@ -139,12 +139,23 @@

- name: Add '--replace' configuration argument
set_fact:
build_agent_cmd_args: "{{ build_agent_cmd_args }} + ['--replace']"
deployment_agent_cmd_args: "{{ build_agent_cmd_args }} + ['--replace']"
resource_agent_cmd_args: "{{ resource_agent_cmd_args }} + ['--replace']"
build_agent_cmd_args: "{{ build_agent_cmd_args + ['--replace'] }}"
deployment_agent_cmd_args: "{{ build_agent_cmd_args + ['--replace'] }}"
resource_agent_cmd_args: "{{ resource_agent_cmd_args + ['--replace'] }}"
when:
- az_devops_agent_replace_existing

- name: Allow configuration to write logs
ansible.builtin.file:
path: "{{ az_devops_agent_folder }}_diag"
owner: "{{ az_devops_agent_user }}"
group: "root"
mode: 'g+w'
state: directory
become: true

- include_tasks: _task_install_dependencies.yml

- name: Configure agent as a build server
command: "{{ (agent_cmd_args + build_agent_cmd_args) | join(' ') }}"
args:
Expand Down
4 changes: 4 additions & 0 deletions tasks/_task_install_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Install dependencies
command: "{{ az_devops_agent_folder }}/bin/installdependencies.sh"
become: true
register: dependency_installation_output
15 changes: 1 addition & 14 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,12 @@

# - debug:
# msg:
# - "Dependency lookup variables are :"
# - "Platform lookup variables are :"
# - "ansible_distribution: {{ ansible_distribution }}"
# - "ansible_distribution_major_version: {{ ansible_distribution_major_version }}"
# - "ansible_os_family: {{ ansible_os_family }}"
# - "ansible_system: {{ ansible_system }}"

- name: Read platform-specific package list variables
include_vars: "{{ varfile }}"
with_first_found:
- files:
- "dependencies-{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "dependencies-{{ ansible_distribution }}.yml"
- "dependencies-{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
- "dependencies-{{ ansible_os_family }}.yml"
- "dependencies-{{ ansible_system }}.yml"
skip: true
loop_control:
loop_var: varfile

- name: Read platform specific tasks
include_tasks: "{{ taskfile }}"
with_first_found:
Expand Down
5 changes: 0 additions & 5 deletions vars/dependencies-Debian-10.yml

This file was deleted.

5 changes: 0 additions & 5 deletions vars/dependencies-Debian-9.yml

This file was deleted.

6 changes: 0 additions & 6 deletions vars/dependencies-RedHat-7.yml

This file was deleted.

5 changes: 0 additions & 5 deletions vars/dependencies-Ubuntu-16.yml

This file was deleted.

5 changes: 0 additions & 5 deletions vars/dependencies-Ubuntu-18.yml

This file was deleted.

6 changes: 0 additions & 6 deletions vars/dependencies-Ubuntu-20.yml

This file was deleted.