Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ jobs:
xcode: 16.2.0
steps:
- checkout
#TODO(regis): remove Rosetta 2 translation for Agent v7.70+
- run:
name: Install Rosetta 2
command: printf 'A\n' | sudo softwareupdate --install-rosetta
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,12 @@ To override the default behavior, set this variable to something other than an e

When the variable `datadog_macos_download_url` is not set, the official macOS DMG package corresponding to the `datadog_agent_major_version` is used:

| Agent version | Default macOS DMG package URL |
|---------------|--------------------------------------------------------------|
| 6 | https://install.datadoghq.com/datadog-agent-6-latest.dmg |
| 7 | https://install.datadoghq.com/datadog-agent-7-latest.dmg |
| Agent version | Default macOS DMG package URL |
|-----------------------|-----------------------------------------------------------------|
| 6 | https://install.datadoghq.com/datadog-agent-6-latest.dmg |
| 7.69- | https://install.datadoghq.com/datadog-agent-7-latest.dmg |
| 7.70+ (Intel Mac) | https://install.datadoghq.com/datadog-agent-7-latest.x86_64.dmg |
| 7.70+ (Apple Silicon) | https://install.datadoghq.com/datadog-agent-7-latest.arm64.dmg |

To override the default behavior, set this variable to something other than an empty string.

Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ datadog_macos_download_url: ""
# These variables are for internal use only, do not modify them.
datadog_macos_agent6_latest_url: "https://install.datadoghq.com/datadog-agent-6-latest.dmg"
datadog_macos_agent7_latest_url: "https://install.datadoghq.com/datadog-agent-7-latest.dmg"
datadog_macos_agent7_latest_arch_url: "https://install.datadoghq.com/datadog-agent-7-latest.{{ ansible_facts.architecture }}.dmg"

# If datadog_agent_version is set, the role will use the following url prefix instead, and append the version number to it
# in order to get the full url to the dmg package.
Expand Down
23 changes: 21 additions & 2 deletions tasks/pkg-macos/macos_agent_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,27 @@
agent_dd_download_url: "{{ datadog_macos_download_url }}"
when: datadog_macos_download_url | default('', true) | length > 0

- name: Check architecture-specific URL for latest Agent 7
ansible.builtin.uri:
url: "{{ datadog_macos_agent7_latest_arch_url }}"
method: GET
follow_redirects: all
return_content: false
status_code: 200
register: datadog_macos_agent7_latest_arch_check
failed_when: false
retries: 2
when:
- datadog_macos_download_url | default('', true) | length == 0
- agent_datadog_agent_major_version | int >= 7

- name: Set agent download filename to latest
ansible.builtin.set_fact:
agent_dd_download_url: "{% if agent_datadog_agent_major_version | int == 7 %}
{{ datadog_macos_agent7_latest_url }} {% else %}{{ datadog_macos_agent6_latest_url }}{% endif %}"
agent_dd_download_url: >-
{%- if agent_datadog_agent_major_version | int < 7 -%}
{{ datadog_macos_agent6_latest_url }}{%- else -%}
{%- if datadog_macos_agent7_latest_arch_check is defined and datadog_macos_agent7_latest_arch_check.status == 200 -%}
{{ datadog_macos_agent7_latest_arch_url }}{%- else -%}
{{ datadog_macos_agent7_latest_url }}{%- endif -%}
{%- endif -%}
when: datadog_macos_download_url | default('', true) | length == 0
4 changes: 3 additions & 1 deletion tasks/pkg-macos/macos_agent_version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
- name: Set agent download filename to a specific version
ansible.builtin.set_fact:
agent_dd_download_url: "{{ datadog_macos_versioned_url }}-{{ agent_datadog_agent_macos_version }}-1.dmg"
agent_dd_download_url: "{{ datadog_macos_versioned_url }}-{{ agent_datadog_agent_macos_version }}-1{{ maybe_arch }}.dmg"
vars:
maybe_arch: "{{ '.' + datadog_agent_macos_architecture if agent_datadog_agent_macos_version is version('7.70', '>=') else '' }}"
Comment thread
rdesgroppes marked this conversation as resolved.
Outdated