naoyayamamoto.awslogs_ec2
Ansible Role: AWSLogsEC2
This role helps you install and set up the AWS CloudWatch Logs Agent.
Requirements
You need Ansible version 2.4 or newer and the EC2_FACTS module.
Role Variables
awslogs_logs:
- file: /var/log/messages # The location of the log file you want to send (required)
format: "%b %d %H:%M:%S" # The date and time format of your log file
time_zone: "LOCAL" # Timezone, can be LOCAL or UTC
initial_position: "start_of_file" # Start sending logs from the beginning
group_name: /var/log/messages # The CloudWatch Logs group name (required)
stream_name: "{instance_id}" # You can use a specific string and/or variable names ({instance_id}, {hostname}, {ip_address})
There is one extra variable not used by default:
awslogs_region: eu-west-1 # Sets a different region for log sending
If your server uses an HTTP or HTTPS proxy, you can set it up with these variables:
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
You can find more details in the Amazon Cloudwatch Logs Documentation.
Dependencies
None
Example 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
License
MIT / BSD
Informazioni sul progetto
An ansible role to install and configure the AWS CloudWatch Logs for EC2
Installa
ansible-galaxy install naoyayamamoto.awslogs_ec2
Licenza
Unknown
Download
74
Proprietario