Last active
May 15, 2019 14:37
-
-
Save piniv/2c5197f821452518b9d1da86cd579155 to your computer and use it in GitHub Desktop.
install and configure awslogs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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