Merged in DCD-697-additional-cw-logs (pull request #31)

DCD-697: Adds ansible and cfn logs to cloudwatch

* DCD-697: Adds ansible and cfn logs to cloudwatch

* DCD-697: Adds provisioning logs to a separarte log group. Adds a test to ensure provisioining logs exist

* DCD-697: Refers to files, not directory, for provisioning log groups

* DCD-697: Adds a comma between log groups

* DCD-697: Removes redundant comma between the 2 log groups

Approved-by: Steve Smith <ssmith@atlassian.com>
Approved-by: Adam Brokes <abrokes@atlassian.com>
This commit is contained in:
Varun Arbatti
2019-10-11 05:04:22 +00:00
parent 564f06522c
commit 0711c75dab
4 changed files with 14 additions and 1 deletions

View File

@@ -45,6 +45,10 @@ atl_product_log_locations:
- "{{ atl_product_home }}/log" - "{{ atl_product_home }}/log"
crowd: [] crowd: []
atl_provisioner_log_locations:
- "/var/log/ansible-bootstrap.log"
- "/var/log/cfn-*.log"
# The following are imports from the environment. These are generally # The following are imports from the environment. These are generally
# set in /etc/atl by the CloudFormation template and sourced before # set in /etc/atl by the CloudFormation template and sourced before
# Ansible is run. See bin/ansible-with-atl-env for a convenient wrapper # Ansible is run. See bin/ansible-with-atl-env for a convenient wrapper

View File

@@ -11,3 +11,4 @@ atl_aws_enable_cloudwatch_logs: false
atl_aws_agent_restart: true atl_aws_agent_restart: true
atl_aws_log_group: "{{ atl_product_edition }}-{{ atl_aws_stack_name }}" atl_aws_log_group: "{{ atl_product_edition }}-{{ atl_aws_stack_name }}"
atl_aws_provisioning_log_group: "{{ atl_aws_log_group }}-provisioning"

View File

@@ -20,6 +20,7 @@ def test_package_exes(host, exe):
def test_service_file(host): def test_service_file(host):
f = host.file('/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json') f = host.file('/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json')
assert f.contains('"log_group_name": "jira-software-MY_STACK"') assert f.contains('"log_group_name": "jira-software-MY_STACK"')
assert f.contains('"log_group_name": "jira-software-MY_STACK-provisioning"')
assert f.user == 'root' assert f.user == 'root'
assert f.group == 'root' assert f.group == 'root'
assert f.mode == 0o0644 assert f.mode == 0o0644

View File

@@ -19,7 +19,14 @@
"log_stream_name": "{instance_id}" "log_stream_name": "{instance_id}"
} }
{% endfor %} {% endfor %}
{% for path in atl_provisioner_log_locations %}
{{ comma() }}
{
"file_path": "{{ path }}",
"log_group_name": "{{ atl_aws_provisioning_log_group }}",
"log_stream_name": "{instance_id}"
}
{% endfor %}
] ]
} }
} }