Skip to content

Instantly share code, notes, and snippets.

@piniv piniv/aws-logs.yml
Last active May 15, 2019

Embed
What would you like to do?
install and configure awslogs
- block: #install and config awslogs
- name: AWSLOGS | check if configuration file is present
stat: "path={{ awslogs_config_file }}"
register: awslogs_status
- block: #only download when awslogs does not exist
- name: AWSLOGS | download installer
get_url:
url: "{{ awslogs_agent_url }}"
dest: /tmp/awslogs-agent-setup.py
- name: AWSLOGS | install deamon
shell: >
"/usr/bin/python /tmp/awslogs-agent-setup.py
--non-interactive --region {{ aws_region }}
-c {{ awslogs_config_file }}
when: not awslogs_status.stat.exists
- name: AWSLOGS | place configuration file
template:
src: awslogs.conf.j2
dest: /var/awslogs/etc/awslogs.conf
- name: AWSLOGS | place configuration file for daemon logging
template:
src: awslogs_logging.conf.j2
dest: /var/awslogs/etc/logging.conf
- name: AWSLOGS | restart agent
service:
name: awslogs
state: restarted
enabled: yes
tags: awslogs
when: common_install_awslogs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.