Giter Club home page Giter Club logo

ansible-role-amazon-cloudwatch-agent's Introduction

ansible-role-amazon-cloudwatch-agent

This role will install the AWS CloudWatch Agent on Ubuntu (64-bit, precise/trusty/xenial).

  • config and credentials are stored in /root/.aws/
  • the process runs as root

See the subdir "ExampleCfgs" for an example of how to configure this role.

Variables

aws_cwa_region

(Optional) AWS region. Defaults to "us-east-1".

aws_cwa_region: "us-east-1"

aws_cwa_namespace

The namespace in which your metrics will reside (e.g. 'myApplication').

aws_cwa_namespace: "myApplication"

aws_cwa_logfiles

(Optional) List of logfiles that you wish to monitor, and their associated parameters -- for example:

aws_cwa_logfiles
  - file_path: '/var/log/syslog'
    log_group_name: 'log_group_name_goes_here'
    log_group_tags:
      - TagKey: TagValue
    log_stream_name: '{{ansible_hostname}}/log_stream_name'
    log_retention: '7'
    timestamp_format: '%b %-d %H:%M:%S'
    timezone: 'LOCAL'

"log_retention" is specified in days, and must be one of: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653.

Omitting the "log_retention" attribute will result in the associated log group having its retention policy, if any, deleted (i.e. 'Never Expire')

aws_cwa_disk_monitor_paths

(Optional) List of paths (i.e. different partitions) that you wish to monitor for space. Defaults to "/". For example:

aws_cwa_disk_monitor_paths:
  - "/"
  - "/opt"

aws_cwa_key_access

AWS access key

aws_cwa_key_access: (encrypted)ACCESSKEYGOESHERE

aws_cwa_key_secret

AWS secret key

aws_cwa_key_secret: (encrypted)SECRETKEYGOESHERE

It's recommended that you declare aws_cwa_key_access and aws_cwa_key_secret in either a vault-encypted var file, or as vault-encrypted strings within a var file.

aws_cwa_cfgs

Path (absolute, or relative to playbook) containing the TEMPLATE named "amazon-cloudwatch-agent.json.j2" for the CloudWatch Agent config

Only "amazon-cloudwatch-agent.json.j2" in the given directory will be processed. The '.j2' extension will be removed.

aws_cwa_cfgs: "group_files/awscwa_cfg/webserver-stg"

Example Playbook

---
- hosts: all
  become: yes
  become_user: root
  roles:
  - ansible-role-amazon-cloudwatch-agent

Example Dir Structure

.
├── group_files
│   └── awscwa_cfg
│       └── webserver-stg
│           └── amazon-cloudwatch-agent.json.j2
├── group_vars
│   └── all.yml
├── inventory
├── main.yml
└── roles
    └── ansible-role-amazon-cloudwatch-agent
        ├── handlers
        │   └── main.yml
        ├── README.md
        └── tasks
            ├── main.yml
            ├── ubuntu-12.yml
            ├── ubuntu-14.yml
            └── ubuntu-16.yml

Author Information

[email protected]

https://github.com/tgam-abarrett

ansible-role-amazon-cloudwatch-agent's People

Contributors

1adam avatar robwhiteongithub avatar tgam-abarrett avatar tgam-tallannder 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.