Code Monkey home page Code Monkey logo

ansible-datadog's Introduction

Ansible Datadog Role

Ansible Galaxy Build Status

Install and configure Datadog base agent & checks. Starting with version 2 of this role version 6 of the agent is installed by default (instead of version 5).

Supports most Debian and RHEL-based Linux distributions.

Installation

ansible-galaxy install Datadog.datadog

Role Variables

  • datadog_api_key - Your Datadog API key.
  • datadog_agent_version - The pinned version of the Agent to install (optional, but highly recommended) Examples: 1:6.0.0-1 on apt-based platforms, 6.0.0-1 on yum-based platforms
  • datadog_checks - YAML configuration for agent checks to drop into /etc/dd-agent/conf.d.
  • datadog_config - Settings to place in the /etc/dd-agent/datadog.conf INI file that go under the [Main] section.
  • datadog_config_ex - Extra INI sections to go in /etc/dd-agent/datadog.conf (optional).
  • datadog_apt_repo - Override default Datadog apt repository
  • datadog_apt_cache_valid_time - Override the default apt cache expiration time (default 1 hour)
  • datadog_apt_key_url_new - Override default url to Datadog apt key (key ID 382E94DE ; the deprecated datadog_apt_key_url variable refers to an expired key that's been removed from the role)
  • datadog_agent_allow_downgrade - Set to yes to allow agent downgrades on apt-based platforms (use with caution, see defaults/main.yml for details)

Agent 5 (older version)

This role includes support for Datadog Agent version 5.

To install agent5, you need to:

  • set datadog_agent5 to true
  • either set datadog_agent_version to an existing agent5 version (recommended) or leave it empty to always install the latest version (5.*).

To downgrade from agent6 to agent5, you need to:

  • set datadog_agent5 to true
  • pin datadog_agent_version to an existing agent5 version
  • set datadog_agent_allow_downgrade to yes

Variables:

  • datadog_agent5 - install an agent5 instead of agent5 (default to false)
  • datadog_agent5_apt_repo - Override default Datadog apt repository for agent5

Dependencies

None

Example Playbooks

- hosts: servers
  roles:
    - { role: Datadog.datadog, become: yes }  # On Ansible < 1.9, use `sudo: yes` instead of `become: yes`
  vars:
    datadog_api_key: "123456"
    datadog_agent_version: "1:6.0.0-1" # for apt-based platforms, use a `6.0.0-1` format on yum-based platforms
    datadog_config:
      tags: "mytag0, mytag1"
      log_level: INFO
      apm_enabled: "true" # has to be set as a string
      log_enabled: true   # log collection is available on agent 6
    datadog_config_ex:
      trace.config:
        env: dev
      trace.concentrator:
        extra_aggregators: version
    datadog_checks:
      process:
        init_config:
        instances:
          - name: ssh
            search_string: ['ssh', 'sshd' ]
          - name: syslog
            search_string: ['rsyslog' ]
            cpu_check_interval: 0.2
            exact_match: true
            ignore_denied_access: true
      ssh_check:
        init_config:
        instances:
          - host: localhost
            port: 22
            username: root
            password: changeme
            sftp_check: True
            private_key_file:
            add_missing_keys: True
      nginx:
        init_config:
        instances:
          - nginx_status_url: http://example.com/nginx_status/
            tags:
              - instance:foo
          - nginx_status_url: http://example2.com:1234/nginx_status/
            tags:
              - instance:bar
        #Log collection is available on agent 6
        logs:
          - type: file
            path: /var/log/access.log
            service: myapp
            source: nginx
            sourcecategory: http_web_access
          - type: file
            path: /var/log/error.log
            service: nginx
            source: nginx
            sourcecategory: http_web_access
- hosts: servers
  roles:
    - { role: Datadog.datadog, become: yes, datadog_api_key: "mykey" }  # On Ansible < 1.9, use `sudo: yes` instead of `become: yes`

Known Issues and Workarounds

On Debian Stretch, the apt_key module that the role uses requires an additional system dependency to work correctly. Unfortunately that dependency (dirmngr) is not provided by the module. To work around this, you can add the following to the playbooks that make use of the present role:

---
- hosts: all
  pre_tasks:
    - name: Debian Stretch requires dirmngr package to be installed in order to use apt_key
      become: yes  # On Ansible < 1.9, use `sudo: yes` instead of `become: yes`
      apt:
        name: dirmngr
        state: present

  roles:
    - { role: Datadog.datadog, become: yes, datadog_api_key: "mykey" }  # On Ansible < 1.9, use `sudo: yes` instead of `become: yes`

License

Apache2

Author Information

[email protected]

[email protected] --Forked from [email protected]

Datadog [email protected] --Forked from [email protected]

ansible-datadog's People

Contributors

bakins avatar brendanlong avatar brouberol avatar chriscannon avatar davidwittman avatar dustinbrown avatar eplanet avatar evnm avatar geoffwright avatar gtrummell avatar hush-hush avatar irabinovitch avatar jeffwidman avatar jeremy-lq avatar jtslear avatar leocavaille avatar lukec avatar nbparis avatar ncracker avatar olivielpeau avatar pmbauer avatar robzienert avatar smcavoy-b avatar stefanfoulis avatar talwai avatar tmichelet avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.