Skip to content

Instantly share code, notes, and snippets.

@piniv
Last active May 15, 2019 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piniv/2c5197f821452518b9d1da86cd579155 to your computer and use it in GitHub Desktop.
Save piniv/2c5197f821452518b9d1da86cd579155 to your computer and use it in GitHub Desktop.
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