Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config directory fix #50

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
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
31 changes: 31 additions & 0 deletions .github/workflows/kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Integration

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
datadog_version: [ 5, 6, 7 ]
os: [ debian-9-2019-2-py3, ubuntu-1804-2019-2-py3, centos-7-2019-2-py3 ]
steps:
- uses: actions/checkout@v2

- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Build and test with Kitchen
run: |
gem install bundler
bundle install --jobs 4 --retry 3

- name: "Running tests for ${{ matrix.datadog_version }}-${{ matrix.os }}"
run: |
bundle exec kitchen test datadog${{ matrix.datadog_version }}-${{ matrix.os }}
10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# General overrides used across formulas in the org
Layout/LineLength:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
Max: 88

# Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`
14 changes: 14 additions & 0 deletions .salt-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
exclude_paths: []
rules: {}
skip_list:
# Using `salt-lint` for linting other files as well, such as Jinja macros/templates
- 205 # Use ".sls" as a Salt State file extension
# Skipping `207` and `208` because `210` is sufficient, at least for the time-being
# I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755`
- 207 # File modes should always be encapsulated in quotation marks
- 208 # File modes should always contain a leading zero
tags: []
verbosity: 1
36 changes: 36 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Extend the `default` configuration provided by `yamllint`
extends: default

# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
# 2. Any SLS files under directory `test/`, which are actually state files
# 3. Any YAML files under directory `.kitchen/`, introduced during local testing
ignore: |
node_modules/
test/**/states/**/*.sls
.kitchen/

yaml-files:
# Default settings
- '*.yaml'
- '*.yml'
- .salt-lint
- .yamllint
# SaltStack Formulas additional settings
- '*.example'
- test/**/*.sls

rules:
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
line-length:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
max: 88
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
28 changes: 28 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Authors

This list is sorted by the number of commits per contributor in _descending_ order.

Avatar|Contributor|Contributions
:-:|---|:-:
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/26872252?v=4' width='36' height='36' alt='@KSerrania'>|[@KSerrania](https://github.com/KSerrania)|25
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/7241?v=4' width='36' height='36' alt='@masci'>|[@masci](https://github.com/masci)|18
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/19755?v=4' width='36' height='36' alt='@alq666'>|[@alq666](https://github.com/alq666)|11
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/7731128?v=4' width='36' height='36' alt='@onlyanegg'>|[@onlyanegg](https://github.com/onlyanegg)|4
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3012076?v=4' width='36' height='36' alt='@fzipi'>|[@fzipi](https://github.com/fzipi)|4
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/980842?v=4' width='36' height='36' alt='@albertvaka'>|[@albertvaka](https://github.com/albertvaka)|3
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1311477?v=4' width='36' height='36' alt='@remh'>|[@remh](https://github.com/remh)|3
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/31497?v=4' width='36' height='36' alt='@MSeven'>|[@MSeven](https://github.com/MSeven)|2
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/3237580?v=4' width='36' height='36' alt='@talwai'>|[@talwai](https://github.com/talwai)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/2253724?v=4' width='36' height='36' alt='@norrland'>|[@norrland](https://github.com/norrland)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/534685?v=4' width='36' height='36' alt='@cedwards'>|[@cedwards](https://github.com/cedwards)|1
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/59497?v=4' width='36' height='36' alt='@davedash'>|[@davedash](https://github.com/davedash)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/289654?v=4' width='36' height='36' alt='@irabinovitch'>|[@irabinovitch](https://github.com/irabinovitch)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/5312195?v=4' width='36' height='36' alt='@nicomfer'>|[@nicomfer](https://github.com/nicomfer)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/4912500?v=4' width='36' height='36' alt='@olivielpeau'>|[@olivielpeau](https://github.com/olivielpeau)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/28675033?v=4' width='36' height='36' alt='@remicalixte'>|[@remicalixte](https://github.com/remicalixte)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/10585477?v=4' width='36' height='36' alt='@blacksmith77'>|[@blacksmith77](https://github.com/blacksmith77)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/8792243?v=4' width='36' height='36' alt='@sc250024'>|[@sc250024](https://github.com/sc250024)|1

---

Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2020-03-19.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## 3.1 / 2020-02-07

Initial support for FreeBSD

## 3.0 / 2019-12-18

**This formula will install Agent v7 by default.** Datadog Agent v7 runs checks with Python 3, so if you were running any custom checks written in Python, they must be compatible with Python 3. If you were not running any custom checks or if your custom checks are already compatible with Python 3, then it is safe to upgrade to Agent v7.
Expand Down
9 changes: 9 additions & 0 deletions FORMULA
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: datadog
os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Amazon, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS
os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS
version: 1.0.0
release: 1
minimum_version: 2017.7
summary: datadog formula
description: Formula to use as a template for other formulas
top_level_dir: datadog
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'kitchen-docker', '>= 2.9'
gem 'kitchen-inspec', '>= 1.1'
gem 'kitchen-salt', '>= 0.6.0'
152 changes: 0 additions & 152 deletions README.rst

This file was deleted.

3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
13 changes: 7 additions & 6 deletions datadog/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ datadog_conf_installed:
- source: salt://datadog/files/datadog.conf.jinja
- user: dd-agent
- group: dd-agent
- mode: 600
- mode: '0600'
- template: jinja
- require:
- pkg: datadog-pkg
Expand All @@ -19,7 +19,7 @@ datadog_yaml_installed:
- source: salt://datadog/files/datadog.yaml.jinja
- user: dd-agent
- group: dd-agent
- mode: 600
- mode: '0600'
- template: jinja
- require:
- pkg: datadog-pkg
Expand All @@ -34,8 +34,9 @@ datadog_{{ check_name }}_folder_installed:
file.directory:
- name: {{ datadog_install_settings.confd_path }}/{{ check_name }}.d
- user: dd-agent
- group: root
- mode: 700
- group: {{ datadog_config.root_group }}
- mode: '0700'
- makedirs: True

# Remove the old config file (if it exists)
datadog_{{ check_name }}_old_yaml_removed:
Expand All @@ -52,8 +53,8 @@ datadog_{{ check_name }}_yaml_installed:
{%- endif %}
- source: salt://datadog/files/conf.yaml.jinja
- user: dd-agent
- group: root
- mode: 600
- group: {{ datadog_config.root_group }}
- mode: '0600'
- template: jinja
- context:
check_name: {{ check_name }}
Expand Down
17 changes: 13 additions & 4 deletions datadog/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ datadog-apt-https:
- name: apt-transport-https
{%- endif %}

{%- if grains['os_family'].lower() != 'freebsd' %}
datadog-repo:
pkgrepo.managed:
- humanname: "Datadog, Inc."
Expand Down Expand Up @@ -60,18 +61,26 @@ datadog-repo:
{%- endif %}
- sslverify: '1'
{% endif %}
{%- endif %}

datadog-pkg:
{%- if latest_agent_version %}
pkg.latest:
- name: datadog-agent
{%- else %}
pkg.installed:
- name: datadog-agent
{%- if latest_agent_version %}
- version: 'latest'
{%- elif grains['os_family'].lower() == 'debian' %}
{%- if grains['os_family'].lower() == 'debian' %}
- version: 1:{{ datadog_install_settings.agent_version }}-1
{%- elif grains['os_family'].lower() == 'redhat' %}
- version: {{ datadog_install_settings.agent_version }}-1
{%- elif grains['os_family'].lower() == 'freebsd' %}
- version: {{ datadog_install_settings.agent_version }}
{%- endif %}
{%- endif %}
- ignore_epoch: True
- refresh: True
{%- if grains['os_family'].lower() != 'freebsd' %}
- require:
- pkgrepo: datadog-repo
- pkgrepo: datadog-repo
{%- endif %}
Loading