24 lines
737 B
YAML
24 lines
737 B
YAML
|
|
---
|
||
|
|
- name: Configure S3 log archival
|
||
|
|
hosts: "{{ target_site }}"
|
||
|
|
become: true
|
||
|
|
tasks:
|
||
|
|
- name: Install AWS CLI
|
||
|
|
snap:
|
||
|
|
name: aws-cli
|
||
|
|
classic: true
|
||
|
|
|
||
|
|
- name: Configure AWS credentials
|
||
|
|
shell: |
|
||
|
|
source /opt/galion/deploy/site_vars/prod.env
|
||
|
|
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
|
||
|
|
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
|
||
|
|
aws configure set default.region $AWS_DEFAULT_REGION
|
||
|
|
|
||
|
|
- name: Schedule Prometheus metrics archival
|
||
|
|
cron:
|
||
|
|
name: "galion s3 archive"
|
||
|
|
minute: "0"
|
||
|
|
hour: "3"
|
||
|
|
job: "aws s3 sync /var/lib/prometheus/data s3://$S3_BUCKET/$(hostname)/$(date +%Y-%m-%d)/ 2>&1 | logger -t galion-s3"
|