Skip to content

Commit 0139658

Browse files
authored
[ansible] Ensure user/group selected for macOS systemwide installation actually exist (#479)
1 parent 94ed3ec commit 0139658

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tasks/pkg-macos.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
msg: "The Datadog ansible role does not currently support Agent 5 on macOS"
77
when: datadog_agent_major_version|int == 5
88

9+
- name: Check if the macOS user for Agent service exists
10+
command: id -u "{{ datadog_macos_user }}"
11+
register: mac_user_check
12+
changed_when: false
13+
ignore_errors: true
14+
15+
- name: Fail if the macOS user for Agent service doesn't exist
16+
fail:
17+
msg: "The Datadog ansible role wasn't able to find the user : {{ datadog_macos_user }}"
18+
when: mac_user_check.rc != 0
19+
920
- include_tasks: pkg-macos/macos_agent_latest.yml
1021
when: (not datadog_skip_install) and (datadog_agent_macos_version is not defined)
1122

0 commit comments

Comments
 (0)