diff --git a/README.md b/README.md index 96a7940..4c0d523 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,11 @@ Available variables are listed below, along with default values (see `defaults/m az_devops_accountname: null az_devops_accesstoken: null az_devops_project_name: null - az_devops_agent_version: 2.188.3 + az_devops_agent_version: 2.218.1 az_devops_agent_user: "az_devops_agent" + az_devops_agent_group: "az_devops_agent" az_devops_agent_uid: null + az_devops_agent_gid: null az_devops_agent_name: "{{ ansible_hostname }}" az_devops_server_url: "https://dev.azure.com/{{ az_devops_accountname }}" az_devops_agent_folder: "/home/{{ az_devops_agent_user }}/agent/" @@ -69,6 +71,10 @@ Available variables are listed below, along with default values (see `defaults/m Default group of the user used to run and configure the service. +- **az_devops_agent_gid** + + GID of the user group used to run and configure the service. + - **az_devops_agent_name** Name of the agent shown in Azure DevOps (defaults to the name of the host.). diff --git a/defaults/main.yml b/defaults/main.yml index 919c7ba..6279e78 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,5 @@ -az_devops_agent_version: 2.188.3 +--- +az_devops_agent_version: 2.218.1 az_devops_agent_user: "az_devops_agent" az_devops_agent_name: "{{ ansible_hostname }}" az_devops_server_url: "https://dev.azure.com/{{ az_devops_accountname }}/" @@ -18,3 +19,5 @@ az_devops_proxy_url: null az_devops_proxy_username: null az_devops_proxy_password: null az_devops_agent_create_local_user: true +az_devops_agent_legacy_dependencies: [] +... diff --git a/meta/main.yml b/meta/main.yml index 329e393..c9c71fc 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,12 +1,14 @@ +--- galaxy_info: role_name: azure_devops_agent - author: Yohan Belval + author: gsoft description: Azure DevOps Agent for Linux. company: GSoft + standalone: true license: "license (Apache-2.0)" - min_ansible_version: 2.4 + min_ansible_version: "2.10" platforms: - name: Ubuntu @@ -14,20 +16,23 @@ galaxy_info: - xenial - bionic - focal + - jammy - name: EL versions: - - 7 + - "7" + - "8" - name: Debian versions: - stretch - buster + - bullseye - name: Windows versions: - - 2016 - - 2019 + - "2016" + - "2019" - name: MacOSX versions: - - 10.15 + - "10.15" galaxy_tags: - azure @@ -37,3 +42,4 @@ galaxy_info: - deployment - ci - cd +... diff --git a/tasks/Darwin.yml b/tasks/Darwin.yml index b870459..54361a8 100644 --- a/tasks/Darwin.yml +++ b/tasks/Darwin.yml @@ -1,14 +1,22 @@ +--- +- name: Add an agent group {{ az_devops_agent_group }} + ansible.builtin.group: + name: "{{ az_devops_agent_group }}" + gid: "{{ az_devops_agent_gid | default(omit) }}" + state: present + become: true + - name: Add an agent user - user: + ansible.builtin.user: name: "{{ az_devops_agent_user }}" comment: "Azure DevOps Agent" shell: /bin/zsh group: "{{ az_devops_agent_group }}" - uid: "{{ az_devops_agent_uid|default(omit) }}" + uid: "{{ az_devops_agent_uid | default(omit) }}" become: true - name: Create directories - file: + ansible.builtin.file: state: directory path: "{{ item }}" owner: "{{ az_devops_agent_user }}" @@ -25,7 +33,7 @@ # even then doesn't use the provided gnu tar. # Makes using ansible on macos a questionable endeavor (but some of us are left with that)... - name: Download agent - get_url: + ansible.builtin.get_url: url: "{{ az_devops_agent_package_url }}" dest: "{{ az_devops_default_agent_local_package }}" owner: "{{ az_devops_agent_user }}" @@ -35,33 +43,33 @@ become: true - name: Unarchive agent - shell: "cd {{ az_devops_agent_folder }} && tar -zxf {{ az_devops_default_agent_local_package }}" + ansible.builtin.shell: "cd {{ az_devops_agent_folder }} && tar -zxf {{ az_devops_default_agent_local_package }}" become: true become_user: "{{ az_devops_agent_user }}" when: agent_download.changed or agent_directory.changed tags: ['skip_ansible_lint'] - name: Check if svc.sh exists - stat: + ansible.builtin.stat: path: "{{ '/'.join((az_devops_agent_folder, 'svc.sh')) }}" register: svc_sh become: true changed_when: false - check_mode: no + check_mode: false - name: Check service status - command: ./svc.sh status + ansible.builtin.command: ./svc.sh status become: true become_user: "{{ az_devops_agent_user }}" args: chdir: "{{ az_devops_agent_folder }}" register: svc_status changed_when: false - check_mode: no + check_mode: false when: svc_sh.stat.exists - name: Set agent config facts - set_fact: + ansible.builtin.set_fact: agent_cmd_args: - "./config.sh" - "--unattended" @@ -88,21 +96,25 @@ reconfigure_or_replace: "{{ az_devops_reconfigure_agent or az_devops_agent_replace_existing }}" - name: Add deployment group tags - set_fact: - deployment_agent_cmd_args: "{{ deployment_agent_cmd_args }} + - ['--addDeploymentGroupTags', '--deploymentGroupTags \\'{{ az_devops_deployment_group_tags }}\\'']" + ansible.builtin.set_fact: + deployment_agent_cmd_args: "{{ deployment_agent_cmd_args + ['--addDeploymentGroupTags', '--deploymentGroupTags', az_devops_deployment_group_tags] }}" + when: + - az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags != None + +- name: Set proxy url + ansible.builtin.set_fact: + agent_cmd_args: "{{ agent_cmd_args + ['--proxyurl', az_devops_proxy_url] }}" when: - - az_devops_deployment_group_tags is defined + - az_devops_proxy_url is defined and az_devops_proxy_url != 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 }}\\'']" +- name: Set proxy username and password + ansible.builtin.set_fact: + agent_cmd_args: "{{ agent_cmd_args + ['--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 != None and az_devops_proxy_username != None and az_devops_proxy_password != None - name: Uninstall agent service - command: ./svc.sh uninstall + ansible.builtin.command: ./svc.sh uninstall become: true become_user: "{{ az_devops_agent_user }}" args: @@ -113,7 +125,7 @@ - reconfigure_or_replace - name: Unconfigure agent - command: "./config.sh remove --auth PAT --token {{ az_devops_accesstoken }}" + ansible.builtin.command: "./config.sh remove --auth PAT --token {{ az_devops_accesstoken }}" args: chdir: "{{ az_devops_agent_folder }}" removes: "{{ az_devops_agent_folder }}/.agent" @@ -124,15 +136,15 @@ - reconfigure_or_replace - 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']" + ansible.builtin.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'] }}" when: - az_devops_agent_replace_existing - name: Configure agent as a build server - command: "{{ (agent_cmd_args + build_agent_cmd_args) | join(' ') }}" + ansible.builtin.command: "{{ (agent_cmd_args + build_agent_cmd_args) | join(' ') }}" args: chdir: "{{ az_devops_agent_folder }}" creates: "{{ az_devops_agent_folder }}/.agent" @@ -143,7 +155,7 @@ - (not service_is_installed) or reconfigure_or_replace - name: Configure agent as a deployment server - command: "{{ (agent_cmd_args + deployment_agent_cmd_args) | join(' ') }}" + ansible.builtin.command: "{{ (agent_cmd_args + deployment_agent_cmd_args) | join(' ') }}" args: chdir: "{{ az_devops_agent_folder }}" creates: "{{ az_devops_agent_folder }}/.agent" @@ -154,7 +166,7 @@ - (not service_is_installed) or reconfigure_or_replace - name: Configure agent as an environment resource - command: "{{ (agent_cmd_args + resource_agent_cmd_args) | join(' ') }}" + ansible.builtin.command: "{{ (agent_cmd_args + resource_agent_cmd_args) | join(' ') }}" args: chdir: "{{ az_devops_agent_folder }}" creates: "{{ az_devops_agent_folder }}/.agent" @@ -165,19 +177,23 @@ - (not service_is_installed) or reconfigure_or_replace - name: Set provided user defined capabilities - ini_file: + community.general.ini_file: path: "{{ az_devops_agent_folder }}/.env" section: null option: "{{ item.key }}" value: "{{ item.value }}" - no_extra_spaces: yes + no_extra_spaces: true owner: "{{ az_devops_agent_user }}" group: "{{ az_devops_agent_group }}" + mode: "0640" loop: "{{ az_devops_agent_user_capabilities | default({}) | dict2items }}" become: true - name: Install agent service - command: ./svc.sh install {{ az_devops_agent_user }} + ansible.builtin.command: ./svc.sh install {{ az_devops_agent_user }} + register: agent_install + failed_when: agent_install.rc != 0 + changed_when: agent_install.rc == 0 become: true become_user: "{{ az_devops_agent_user }}" args: @@ -186,10 +202,14 @@ - (not service_is_installed) or reconfigure_or_replace - name: Start agent service - command: ./svc.sh start + ansible.builtin.command: ./svc.sh start + register: agent_start + failed_when: agent_start.rc != 0 + changed_when: agent_start.rc == 0 become: true become_user: "{{ az_devops_agent_user }}" args: chdir: "{{ az_devops_agent_folder }}" when: - (not service_is_running) or reconfigure_or_replace +... diff --git a/tasks/Linux.yml b/tasks/Linux.yml index ae60468..cb8db03 100644 --- a/tasks/Linux.yml +++ b/tasks/Linux.yml @@ -1,14 +1,21 @@ +--- +- name: Add an agent group {{ az_devops_agent_group }} + ansible.builtin.group: + name: "{{ az_devops_agent_group }}" + gid: "{{ az_devops_agent_gid | default(omit) }}" + state: present + - name: Add an agent user - user: + ansible.builtin.user: name: "{{ az_devops_agent_user }}" group: "{{ az_devops_agent_group }}" - uid: "{{ az_devops_agent_uid|default(omit) }}" + uid: "{{ az_devops_agent_uid | default(omit) }}" comment: "Azure DevOps Agent" shell: /bin/bash become: true - name: Create directories - file: + ansible.builtin.file: state: directory path: "{{ item }}" owner: "{{ az_devops_agent_user }}" @@ -19,50 +26,65 @@ - "{{ az_devops_work_folder }}" become: true +- name: Install Legacy dependencies + ansible.builtin.apt: + deb: "{{ item }}" + state: present + loop: "{{ az_devops_agent_legacy_dependencies }}" + become: true + when: ansible_os_family == "Debian" + +- name: Patch openssl config when using legacy ssl 1 on modern system + ansible.builtin.lineinfile: + dest: /etc/ssl/openssl.cnf + regexp: '^openssl_conf =' + line: '# openssl_conf =' + when: az_devops_agent_legacy_dependencies | length>0 + - name: Install dependencies - package: + ansible.builtin.package: name: "{{ az_devops_agent_dependencies }}" state: present become: true - name: Check if svc.sh exists - stat: + ansible.builtin.stat: path: "{{ '/'.join((az_devops_agent_folder, 'svc.sh')) }}" register: svc_sh become: true changed_when: false - check_mode: no + check_mode: false - name: Check service status - command: ./svc.sh status + ansible.builtin.command: ./svc.sh status become: true args: chdir: "{{ az_devops_agent_folder }}" register: svc_status changed_when: false - check_mode: no + check_mode: false when: svc_sh.stat.exists - name: Check if bin/Agent.Listener exists - stat: + ansible.builtin.stat: path: "{{ '/'.join((az_devops_agent_folder, 'bin/Agent.Listener')) }}" register: bin_agent_listener become: true changed_when: false - check_mode: no + check_mode: false - name: Check agent version - command: ./bin/Agent.Listener --version + ansible.builtin.command: ./bin/Agent.Listener --version become: true args: chdir: "{{ az_devops_agent_folder }}" register: agent_listener_version changed_when: false - check_mode: no + check_mode: false when: bin_agent_listener.stat.exists - name: Set agent config facts - set_fact: + ansible.builtin.set_fact: agent_cmd_args: - "./config.sh" - "--unattended" @@ -89,27 +111,38 @@ is_requested_version: "{{ bin_agent_listener.stat.exists and agent_listener_version.stdout is defined and agent_listener_version.stdout == az_devops_agent_version }}" - name: Determine if the agent should be reconfigured or replaced - set_fact: + ansible.builtin.set_fact: reconfigure_or_replace: "{{ az_devops_reconfigure_agent or az_devops_agent_replace_existing or not is_requested_version }}" - name: Add deployment group tags - set_fact: - deployment_agent_cmd_args: "{{ deployment_agent_cmd_args }} + - ['--addDeploymentGroupTags', '--deploymentGroupTags \\'{{ az_devops_deployment_group_tags }}\\'']" + ansible.builtin.set_fact: + deployment_agent_cmd_args: "{{ deployment_agent_cmd_args + ['--addDeploymentGroupTags', '--deploymentGroupTags', az_devops_deployment_group_tags] }}" + when: + - az_devops_deployment_group_tags is defined and az_devops_deployment_group_tags != None + +- name: Set proxy url + ansible.builtin.set_fact: + agent_cmd_args: "{{ agent_cmd_args + ['--proxyurl', az_devops_proxy_url] }}" when: - - az_devops_deployment_group_tags is defined + - az_devops_proxy_url is defined and az_devops_proxy_url != 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 }}\\'']" +- name: Set proxy user and password + ansible.builtin.set_fact: + agent_cmd_args: "{{ agent_cmd_args + ['--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 != None and az_devops_proxy_username != None and az_devops_proxy_password != None + +- name: Download {{ az_devops_agent_package_url }} + ansible.builtin.get_url: + url: "{{ az_devops_agent_package_url }}" + dest: "/tmp/az_devops_agent_package.tar.gz" + mode: "0644" -- name: Download and unarchive - unarchive: - src: "{{ az_devops_agent_package_url }}" +- name: Unarchive /tmp/az_devops_agent_package.tar.gz + ansible.builtin.unarchive: + src: "/tmp/az_devops_agent_package.tar.gz" dest: "{{ az_devops_agent_folder }}" - remote_src: yes + remote_src: true owner: "{{ az_devops_agent_user }}" group: "{{ az_devops_agent_group }}" become: true @@ -117,7 +150,7 @@ - (not service_is_installed) or reconfigure_or_replace - name: Uninstall agent service - command: ./svc.sh uninstall + ansible.builtin.command: ./svc.sh uninstall become: true args: chdir: "{{ az_devops_agent_folder }}" @@ -127,7 +160,7 @@ - reconfigure_or_replace - name: Unconfigure agent - command: "./config.sh remove --auth PAT --token {{ az_devops_accesstoken }}" + ansible.builtin.command: "./config.sh remove --auth PAT --token {{ az_devops_accesstoken }}" args: chdir: "{{ az_devops_agent_folder }}" removes: "{{ az_devops_agent_folder }}/.agent" @@ -138,15 +171,15 @@ - reconfigure_or_replace - 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']" + ansible.builtin.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'] }}" when: - az_devops_agent_replace_existing - name: Configure agent as a build server - command: "{{ (agent_cmd_args + build_agent_cmd_args) | join(' ') }}" + ansible.builtin.command: "{{ (agent_cmd_args + build_agent_cmd_args) | join(' ') }}" args: chdir: "{{ az_devops_agent_folder }}" creates: "{{ az_devops_agent_folder }}/.agent" @@ -157,7 +190,7 @@ - (not service_is_installed) or reconfigure_or_replace - name: Configure agent as a deployment server - command: "{{ (agent_cmd_args + deployment_agent_cmd_args) | join(' ') }}" + ansible.builtin.command: "{{ (agent_cmd_args + deployment_agent_cmd_args) | join(' ') }}" args: chdir: "{{ az_devops_agent_folder }}" creates: "{{ az_devops_agent_folder }}/.agent" @@ -168,7 +201,7 @@ - (not service_is_installed) or reconfigure_or_replace - name: Configure agent as an environment resource - command: "{{ (agent_cmd_args + resource_agent_cmd_args) | join(' ') }}" + ansible.builtin.command: "{{ (agent_cmd_args + resource_agent_cmd_args) | join(' ') }}" args: chdir: "{{ az_devops_agent_folder }}" creates: "{{ az_devops_agent_folder }}/.agent" @@ -184,14 +217,18 @@ section: null option: "{{ item.key }}" value: "{{ item.value }}" - no_extra_spaces: yes + no_extra_spaces: true owner: "{{ az_devops_agent_user }}" group: "{{ az_devops_agent_group }}" + mode: "0640" loop: "{{ az_devops_agent_user_capabilities | default({}) | dict2items }}" become: true - name: Install agent service - command: ./svc.sh install {{ az_devops_agent_user }} + ansible.builtin.command: ./svc.sh install {{ az_devops_agent_user }} + register: agent_install + failed_when: agent_install.rc != 0 + changed_when: agent_install.rc == 0 become: true args: chdir: "{{ az_devops_agent_folder }}" @@ -199,9 +236,13 @@ - (not service_is_installed) or reconfigure_or_replace - name: Start agent service - command: ./svc.sh start + ansible.builtin.command: ./svc.sh start + register: agent_start + failed_when: agent_start.rc != 0 + changed_when: agent_start.rc == 0 become: true args: chdir: "{{ az_devops_agent_folder }}" when: - (not service_is_running) or reconfigure_or_replace +... diff --git a/tasks/Windows.yml b/tasks/Windows.yml index ceaedaa..1850fb4 100644 --- a/tasks/Windows.yml +++ b/tasks/Windows.yml @@ -1,15 +1,16 @@ +--- - name: Add an agent user - win_user: + ansible.windows.win_user: name: "{{ az_devops_agent_user }}" password: "{{ az_devops_agent_password }}" state: present password_never_expires: true - become: yes + become: true when: - az_devops_agent_create_local_user - + - name: Ensure chocolatey is present - win_chocolatey: + chocolatey.chocolatey.win_chocolatey: name: chocolatey state: present @@ -17,7 +18,7 @@ # https://github.com/flcdrg/au-packages/blob/master/azure-pipelines-agent/README.md - name: Set basic agent package parameters - set_fact: + ansible.builtin.set_fact: common_install_options: - "/Directory:{{ az_devops_agent_folder }}" - "/Url:{{ az_devops_server_url }}" @@ -41,56 +42,57 @@ - "/ProjectName:{{ az_devops_project_name }}" - name: Add '/Replace' configuration argument - set_fact: - common_install_options: "{{ common_install_options }} + ['/Replace']" + ansible.builtin.set_fact: + common_install_options: "{{ common_install_options + ['/Replace'] }}" when: - az_devops_agent_replace_existing - name: Add deployment group tags - set_fact: - deployment_install_options: "{{ deployment_install_options }} + ['/DeploymentGroupTags:{{ az_devops_deployment_group_tags }}']" + ansible.builtin.set_fact: + deployment_install_options: "{{ deployment_install_options + ['/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 != None - name: Add az_devops_proxy_url - set_fact: - common_install_options: "{{ common_install_options }} + ['/ProxyUrl:{{ az_devops_proxy_url }}']" + ansible.builtin.set_fact: + common_install_options: "{{ common_install_options + ['/ProxyUrl:' + az_devops_proxy_url ] }}" when: - - az_devops_proxy_url is defined and az_devops_proxy_url + - az_devops_proxy_url is defined and az_devops_proxy_url != None - name: Add az_devops_proxy_username - set_fact: - common_install_options: "{{ common_install_options }} + ['/ProxyUserName:{{ az_devops_proxy_username }}']" + ansible.builtin.set_fact: + common_install_options: "{{ common_install_options + ['/ProxyUserName:'+ az_devops_proxy_username ] }}" when: - - az_devops_proxy_username is defined and az_devops_proxy_username + - az_devops_proxy_username is defined and az_devops_proxy_username != None - name: Add az_devops_proxy_password - set_fact: - common_install_options: "{{ common_install_options }} + ['/ProxyPassword:{{ az_devops_proxy_password }}']" + ansible.builtin.set_fact: + common_install_options: "{{ common_install_options + ['/ProxyPassword:' + az_devops_proxy_password ] }}" when: - - az_devops_proxy_password is defined and az_devops_proxy_password + - az_devops_proxy_password is defined and az_devops_proxy_password != None - name: Configure agent as a build server - set_fact: - az_devops_agent_package_params: "{{ common_install_options }} + {{ build_agent_install_options }}" + ansible.builtin.set_fact: + az_devops_agent_package_params: "{{ common_install_options + build_agent_install_options }}" when: - - az_devops_agent_role == 'build' + - az_devops_agent_role == 'build' - name: Configure agent as a deployment server - set_fact: - az_devops_agent_package_params: "{{ common_install_options }} + {{ deployment_install_options }}" + ansible.builtin.set_fact: + az_devops_agent_package_params: "{{ common_install_options + deployment_install_options }}" when: - - az_devops_agent_role == 'deployment' + - az_devops_agent_role == 'deployment' - name: Configure agent as an environment resource - set_fact: - az_devops_agent_package_params: "{{ common_install_options }} + {{ resource_agent_install_options }}" + ansible.builtin.set_fact: + az_devops_agent_package_params: "{{ common_install_options + resource_agent_install_options }}" when: - - az_devops_agent_role == 'resource' + - az_devops_agent_role == 'resource' - name: Install azure-pipelines-agent package - win_chocolatey: + chocolatey.chocolatey.win_chocolatey: name: azure-pipelines-agent state: present version: "{{ az_devops_agent_version }}" package_params: "{{ az_devops_agent_package_params | join(' ') }}" +... diff --git a/tasks/main.yml b/tasks/main.yml index 4cd12b9..120408d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Read platform-specific variables - include_vars: "{{ varfile }}" + ansible.builtin.include_vars: "{{ varfile }}" with_first_found: - files: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" @@ -20,7 +20,7 @@ # - "ansible_system: {{ ansible_system }}" - name: Read platform-specific package list variables - include_vars: "{{ varfile }}" + ansible.builtin.include_vars: "{{ varfile }}" with_first_found: - files: - "dependencies-{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" @@ -33,11 +33,12 @@ loop_var: varfile - name: Read platform specific tasks - include_tasks: "{{ taskfile }}" + ansible.builtin.include_tasks: "{{ taskfile }}" with_first_found: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" - "{{ ansible_distribution }}.yml" - "{{ ansible_os_family }}.yml" - "{{ ansible_system }}.yml" loop_control: - loop_var: taskfile \ No newline at end of file + loop_var: taskfile +... diff --git a/vars/Darwin.yml b/vars/Darwin.yml index 6216612..98f8383 100644 --- a/vars/Darwin.yml +++ b/vars/Darwin.yml @@ -1,6 +1,8 @@ +--- az_devops_default_agent_folder: "/Users/{{ az_devops_agent_user }}/agent/" az_devops_default_work_folder: "/Users/{{ az_devops_agent_user }}/agent/_work" az_devops_launchagent_folder: "/Users/{{ az_devops_agent_user }}/Library/LaunchAgents" az_devops_default_agent_package_url: "https://vstsagentpackage.azureedge.net/agent/{{ az_devops_agent_version }}/vsts-agent-osx-x64-{{ az_devops_agent_version }}.tar.gz" az_devops_default_agent_local_package: "/Users/{{ az_devops_agent_user }}/vsts-agent-osx-x64-{{ az_devops_agent_version }}.tar.gz" -az_devops_default_agent_group: admin \ No newline at end of file +az_devops_default_agent_group: admin +... diff --git a/vars/Linux.yml b/vars/Linux.yml index 7f9e0b7..8d46b72 100644 --- a/vars/Linux.yml +++ b/vars/Linux.yml @@ -1,4 +1,6 @@ +--- az_devops_default_agent_folder: "/home/{{ az_devops_agent_user }}/agent/" az_devops_default_work_folder: "/home/{{ az_devops_agent_user }}/agent/_work" az_devops_default_agent_package_url: "https://vstsagentpackage.azureedge.net/agent/{{ az_devops_agent_version }}/vsts-agent-linux-x64-{{ az_devops_agent_version }}.tar.gz" az_devops_default_agent_group: "{{ az_devops_agent_user }}" +... diff --git a/vars/Windows.yml b/vars/Windows.yml index e3cfd3d..517ba14 100644 --- a/vars/Windows.yml +++ b/vars/Windows.yml @@ -1,5 +1,7 @@ +--- az_devops_default_agent_folder: "C:/a" az_devops_default_work_folder: "C:/w" az_devops_default_agent_package_url: "https://vstsagentpackage.azureedge.net/agent/{{ az_devops_agent_version }}/vsts-agent-win-x64-{{ az_devops_agent_version }}.zip" az_devops_default_agent_local_package: "C:/vsts-agent-win-x64-{{ az_devops_agent_version }}.zip" az_devops_default_agent_group: "{{ az_devops_agent_user }}" +... diff --git a/vars/dependencies-Debian-10.yml b/vars/dependencies-Debian-10.yml index 06f5506..0ef2118 100644 --- a/vars/dependencies-Debian-10.yml +++ b/vars/dependencies-Debian-10.yml @@ -1,5 +1,7 @@ +--- az_devops_agent_dependencies: - libcurl4 - libgssapi-krb5-2 - libicu63 - libssl1.1 +... diff --git a/vars/dependencies-Debian-11.yml b/vars/dependencies-Debian-11.yml new file mode 100644 index 0000000..6718544 --- /dev/null +++ b/vars/dependencies-Debian-11.yml @@ -0,0 +1,9 @@ +--- +az_devops_agent_dependencies: + - libcurl4 + - libgssapi-krb5-2 + - libicu67 + +az_devops_agent_legacy_dependencies: + - http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb +... diff --git a/vars/dependencies-Debian-9.yml b/vars/dependencies-Debian-9.yml index f31022b..8faafb8 100644 --- a/vars/dependencies-Debian-9.yml +++ b/vars/dependencies-Debian-9.yml @@ -1,5 +1,7 @@ +--- az_devops_agent_dependencies: - libcurl3 - libgssapi-krb5-2 - libicu57 - libssl1.1 +... diff --git a/vars/dependencies-RedHat-7.yml b/vars/dependencies-RedHat-7.yml index e911977..d4beeb7 100644 --- a/vars/dependencies-RedHat-7.yml +++ b/vars/dependencies-RedHat-7.yml @@ -1,6 +1,8 @@ +--- az_devops_agent_dependencies: - krb5-libs - libicu - lttng-ust - openssl-libs - - zlib \ No newline at end of file + - zlib +... diff --git a/vars/dependencies-RedHat-8.yml b/vars/dependencies-RedHat-8.yml new file mode 100644 index 0000000..59b5a84 --- /dev/null +++ b/vars/dependencies-RedHat-8.yml @@ -0,0 +1,10 @@ +--- +az_devops_agent_dependencies: + - krb5-libs + - libicu + - lttng-ust + - openssl-libs + - zlib + # mine only found the script install libicu lttng-ust userspace-rcu + - userspace-rcu +... diff --git a/vars/dependencies-Ubuntu-16.yml b/vars/dependencies-Ubuntu-16.yml index 97d3e81..c0d9ddb 100644 --- a/vars/dependencies-Ubuntu-16.yml +++ b/vars/dependencies-Ubuntu-16.yml @@ -1,5 +1,7 @@ +--- az_devops_agent_dependencies: - libcurl3 - libgssapi-krb5-2 - libicu55 - libssl1.0.0 +... diff --git a/vars/dependencies-Ubuntu-18.yml b/vars/dependencies-Ubuntu-18.yml index 7e83e70..b3dd775 100644 --- a/vars/dependencies-Ubuntu-18.yml +++ b/vars/dependencies-Ubuntu-18.yml @@ -1,5 +1,7 @@ +--- az_devops_agent_dependencies: - libcurl4 - libgssapi-krb5-2 - libicu60 - libssl1.1 +... diff --git a/vars/dependencies-Ubuntu-20.yml b/vars/dependencies-Ubuntu-20.yml index 1ba64cb..4803477 100644 --- a/vars/dependencies-Ubuntu-20.yml +++ b/vars/dependencies-Ubuntu-20.yml @@ -1,6 +1,8 @@ +--- az_devops_agent_dependencies: - libcurl4 - libgssapi-krb5-2 - libicu66 - libssl1.1 - acl +... diff --git a/vars/dependencies-Ubuntu-22.yml b/vars/dependencies-Ubuntu-22.yml new file mode 100644 index 0000000..3ec6033 --- /dev/null +++ b/vars/dependencies-Ubuntu-22.yml @@ -0,0 +1,10 @@ +--- +az_devops_agent_dependencies: + - libcurl4 + - libgssapi-krb5-2 + - libicu70 + - acl + +az_devops_agent_legacy_dependencies: + - http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb +...