Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ commands:
python: "<<parameters.python>>"

jobs:
# TODO: Use 2.10 image, fix file permission errors (E208) that arise.
ansible_lint:
docker:
- image: datadog/docker-library:ansible_debian_2_7
- image: datadog/docker-library:ansible_debian_2_10
steps:
- checkout
- run: pip install ansible-lint
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ datadog_config_ex:
custom_sensitive_words: "<FIRST_WORD>,<SECOND_WORD>"
```

### Additional tasks

`pre_tasks` and `post_tasks` folders are available to run user defined tasks. `pre_tasks` run before executing any tasks from the Datadog Ansible role, and `post_tasks` run after execution of the role.

Installation tasks on supported platforms register the variable `datadog_agent_install`, which can be used in `post_tasks` to check the installation task's result. `datadog_agent_install.changed` is set to `true` if the installation task did install something, and `false` otherwise (for instance if the requested version was already installed).

## Versions

By default, the current major version of the Datadog Ansible role installs Agent v7. The variables `datadog_agent_version` and `datadog_agent_major_version` are available to control the Agent version installed.
Expand Down
2 changes: 2 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
galaxy_info:
role_name: datadog
namespace: datadog
author: 'Brian Akins, Dustin Brown & Datadog'
description: Install Datadog agent and configure checks
license: Apache2
Expand Down
3 changes: 3 additions & 0 deletions tasks/agent-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
file:
dest: /etc/datadog-agent
state: directory
mode: 0755

- name: Create main Datadog agent configuration file
template:
Expand Down Expand Up @@ -52,6 +53,7 @@
state: directory
owner: "{{ datadog_user }}"
group: "{{ datadog_group }}"
mode: 0755
with_items: '{{ datadog_checks|list }}'

- name: Create a configuration file for each Datadog check
Expand Down Expand Up @@ -138,3 +140,4 @@
dest: /etc/datadog-agent/install_info
owner: "{{ datadog_user }}"
group: "{{ datadog_group }}"
mode: 0644
2 changes: 2 additions & 0 deletions tasks/agent-win.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: Create main Datadog agent configuration file
win_template:
#FIXME: should have permissions set to only be readable by ddagentuser
src: datadog.yaml.j2
dest: "{{ datadog_windows_config_root }}\\datadog.yaml"
notify: restart datadog-agent-win
Expand Down Expand Up @@ -77,3 +78,4 @@
template:
src: install_info.j2
dest: "{{ datadog_windows_config_root }}\\install_info"
mode: 0644
10 changes: 3 additions & 7 deletions tasks/agent5-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
file:
dest: /etc/dd-agent
state: directory
mode: 0755

- name: (agent5) Create main Datadog agent configuration file
template:
src: datadog.conf.j2
dest: /etc/dd-agent/datadog.conf
owner: "{{ datadog_user }}"
group: "{{ datadog_group }}"
mode: 0644 #FIXME: should have permissions set to only be readable by owner
notify: restart datadog-agent

- name: (agent5) Ensure datadog-agent is running
Expand Down Expand Up @@ -67,12 +69,6 @@
dest: "/etc/dd-agent/conf.d/{{ item }}.yaml"
owner: "{{ datadog_user }}"
group: "{{ datadog_group }}"
mode: 0644 #FIXME: should have permissions set to only be readable by owner
with_items: "{{ datadog_checks|list }}"
notify: restart datadog-agent

- name: Create installation information file
template:
src: install_info.j2
dest: /etc/dd-agent/install_info
owner: "{{ datadog_user }}"
group: "{{ datadog_group }}"
8 changes: 0 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,3 @@
- name: Integrations Tasks
include_tasks: integration.yml
when: datadog_integration is defined

- name: Post Tasks
include_tasks: post_tasks/*.yml
when: post_tasks is defined

- name: Pre Tasks
include_tasks: pre_tasks/*.yml
when: pre_tasks is defined
1 change: 1 addition & 0 deletions tasks/pkg-suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
dest: /etc/zypp/repos.d/datadog.repo
owner: "root"
group: "root"
mode: 0644
register: datadog_zypper_repo

# refresh zypper repos only if the template changed
Expand Down