File tree Expand file tree Collapse file tree 6 files changed +11
-11
lines changed
Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 44
55- name : add "{{ datadog_user }}" user to additional groups
66 user : name="{{ datadog_user }}" groups="{{ datadog_additional_groups }}" append=yes
7- when : datadog_additional_groups is defined and (datadog_additional_groups | length != 0)
7+ when : datadog_additional_groups | default([], true) | length > 0
88 notify : restart datadog-agent
99
1010- name : Create Datadog agent config directory
Original file line number Diff line number Diff line change 2424
2525- name : Linux Configuration Tasks (Agent 5)
2626 include_tasks : agent5-linux.yml
27- when : datadog_agent_major_version| int == 5 and ansible_os_family != "Windows"
27+ when : datadog_agent_major_version | int == 5 and ansible_os_family != "Windows"
2828
2929- name : Linux Configuration Tasks
3030 include_tasks : agent-linux.yml
31- when : datadog_agent_major_version| int > 5 and ansible_os_family != "Windows"
31+ when : datadog_agent_major_version | int > 5 and ansible_os_family != "Windows"
3232
3333- name : Windows Configuration Tasks
3434 include_tasks : agent-win.yml
35- when : datadog_agent_major_version| int > 5 and ansible_os_family == "Windows"
35+ when : datadog_agent_major_version | int > 5 and ansible_os_family == "Windows"
3636
3737- name : Integrations Tasks
3838 include_tasks : integration.yml
Original file line number Diff line number Diff line change 11- name : Set DD Username Arg
22 set_fact :
33 win_install_args : " {{ win_install_args }} DDAGENTUSER_NAME={{ datadog_windows_ddagentuser_name }}"
4- when : datadog_windows_ddagentuser_name | length > 0
4+ when : datadog_windows_ddagentuser_name | default('', true) | length > 0
55
66- name : Set DD Password Arg
77 set_fact :
88 win_install_args : " {{ win_install_args }} DDAGENTUSER_PASSWORD={{ datadog_windows_ddagentuser_password }}"
9- when : datadog_windows_ddagentuser_password | length > 0
9+ when : datadog_windows_ddagentuser_password | default('', true) | length > 0
1010
1111# check the registry. On upgrade, the location of the config file root will
1212# be set here.
Original file line number Diff line number Diff line change 11---
22- name : Convert datadog_agent_major_version to string
33 set_fact :
4- datadog_agent_major_version : " {{ datadog_agent_major_version | string }}"
4+ datadog_agent_major_version : " {{ datadog_agent_major_version | default('', true) | string }}"
55
66- include_tasks : parse-version.yml
7- when : datadog_agent_version | length > 0
7+ when : datadog_agent_version | default('', true) | length > 0
88
99- name : Set Agent default major version
1010 set_fact :
Original file line number Diff line number Diff line change 33- name : (Custom) Set agent download filename to latest
44 set_fact :
55 dd_download_url : " {{ datadog_windows_download_url }}"
6- when : datadog_windows_download_url | length > 0
6+ when : datadog_windows_download_url | default('', true) | length > 0
77
88- name : Set agent download filename to latest
99 set_fact :
1010 dd_download_url : " {% if datadog_agent_major_version|int == 7 %}{{ datadog_windows_agent7_latest_url }}
1111 {% else %}{{ datadog_windows_agent6_latest_url }}{% endif %}"
12- when : datadog_windows_download_url | length == 0
12+ when : datadog_windows_download_url | default('', true) | length == 0
Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ dd_url: {{ datadog_url }}
1414api_key: {{ datadog_api_key | default('youshouldsetthis') }}
1515{% endif %}
1616
17- {% if datadog_config is defined and datadog_config | length > 0 -%}
17+ {% if datadog_config | default ({}, true ) | length > 0 -%}
1818{{ datadog_config | to_nice_yaml }}
1919{% endif %}
You can’t perform that action at this time.
0 commit comments