Skip to content

Commit

Permalink
[ansible] Ensure user/group selected for macOS systemwide installatio…
Browse files Browse the repository at this point in the history
…n actually exist (#479)
  • Loading branch information
Pythyu authored Apr 6, 2023
1 parent 94ed3ec commit 0139658
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tasks/pkg-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
msg: "The Datadog ansible role does not currently support Agent 5 on macOS"
when: datadog_agent_major_version|int == 5

- name: Check if the macOS user for Agent service exists
command: id -u "{{ datadog_macos_user }}"
register: mac_user_check
changed_when: false
ignore_errors: true

- name: Fail if the macOS user for Agent service doesn't exist
fail:
msg: "The Datadog ansible role wasn't able to find the user : {{ datadog_macos_user }}"
when: mac_user_check.rc != 0

- include_tasks: pkg-macos/macos_agent_latest.yml
when: (not datadog_skip_install) and (datadog_agent_macos_version is not defined)

Expand Down

0 comments on commit 0139658

Please sign in to comment.