naoyayamamoto.awslogs_ec2

Ansible Rolle: AWSLogsEC2

Build-Status Ansible Galaxy

Diese Rolle installiert und konfiguriert den AWS CloudWatch Logs Agent.

Anforderungen

Diese Rolle benötigt nur Ansible Version 2.4+ und das EC2_FACTS-Modul.

Rollenvariablen


awslogs_logs:
  - file:  /var/log/messages          # Der Pfad zur Protokolldatei, die Sie übertragen möchten (erforderlich)
    format: "%b %d %H:%M:%S"          # Das Datum- und Zeitformat der Protokolldatei
    time_zone: "LOCAL"                # Zeitzone, kann entweder LOCAL oder UTC sein
    initial_position: "start_of_file" # Von wo die Protokollübertragung beginnen soll
    group_name: /var/log/messages     # Der Cloudwatch Logs Gruppenname (erforderlich)
    stream_name: "{instance_id}"      # Sie können einen festen String und/oder vordefinierte Variablen verwenden ({instance_id}, {hostname}, {ip_address})

Zusätzlich gibt es drei Variablen, die standardmäßig nicht verwendet werden:

awslogs_region: eu-west-1            # Überschreibt die lokale Region für die Protokollübertragung

Wenn Ihre Instanz hinter einem HTTP- oder HTTPS-Proxy steht, können Sie dies mit den folgenden Variablen konfigurieren:

awslogs_enable_proxy: true
awslogs_http_proxy: http://your.proxy:80/
awslogs_https_proxy: http://your.https.proxy:80/
awslogs_noproxy: 169.254.169.254

Diese Konfiguration wird weiter in der Amazon Cloudwatch Logs Dokumentation erläutert.

Abhängigkeiten

Keine

Beispiel-Playbook

---

- hosts: all

  vars:
    awslogs_region: eu-west-1
    awslogs_logs:
    - file: /var/log/messages
      format: "%b %d %H:%M:%S"
      time_zone: "LOCAL"
      initial_position: "start_of_file"
      group_name: /var/log/messages
      stream_name: "{instance_id}"

  roles:
    - naoyayamamoto.awslogs_ec2

Lizenz

MIT / BSD

Über das Projekt

An ansible role to install and configure the AWS CloudWatch Logs for EC2

Installieren
ansible-galaxy install naoyayamamoto.awslogs_ec2
GitHub Repository
Lizenz
Unknown
Downloads
74
Besitzer