This file contains hidden or 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
# POST to Logentries and create the new log, note: | |
# - provide our API key in the `x-api-key` header | |
# - Logentries API responds with a 201, so that is a successful response (status_code) | |
# - provide our Logset id so that our new log will be created in it | |
- name: create Log in Logentries if it doesn't exist - {{ item }} | |
uri: | |
url: https://rest.logentries.com/management/logs | |
headers: | |
x-api-key: "{{ logentries_api_key }}" | |
method: POST |
This file contains hidden or 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
# pull down the current state of our Logentries logs from the REST API | |
- name: retrieve Logsets info from Logentries | |
uri: | |
url: https://rest.logentries.com/management/logsets | |
headers: | |
x-api-key: "{{ logentries_api_key }}" | |
method: GET | |
return_content: yes | |
register: logentries_logsets_info |
This file contains hidden or 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
# group_vars/project.ansibled.yml | |
# Logentries REST API key -- read/write | |
logentries_api_key: !vault | | |
$ANSIBLE_VAULT;1.1;AES256 | |
62336430323434343665653736376339333661356535336132326634353934356634666338316333 | |
6264376536343862303962383638303037366634343137350a346364663835663964333136366330 | |
37333564373232393966616164643539373534393761303332306438353562663434636466353431 | |
3430373764336439330a386339636234323566653436393136313762356537343637326239356139 | |
6332 |
This file contains hidden or 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
logentries-very-important-service: | |
container_name: logentries_very_important_service | |
image: logentries/docker-logentries | |
command: -t ${LOGENTRIES_VERY_IMPORTANT_SERVICE} --no-stats --matchByName very_important_service | |
restart: unless-stopped | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock |
This file contains hidden or 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
# aurora.yml | |
# --- | |
# playbook that builds Aurora clusters and Aurora DB instances | |
# first run a play for any cluster hosts to create them | |
- hosts: aurora.cluster | |
environment: | |
AWS_ACCESS_KEY_ID: "{{ aws_access_key }}" | |
AWS_SECRET_ACCESS_KEY: "{{ aws_secret_key }}" | |
AWS_REGION: "{{ aws_region }}" |
This file contains hidden or 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
# host_vars/dba.aurora.ansibled.yml | |
# --- | |
# specific configuration for one of our Aurora DBs | |
aurora_cluster_name: ansibled-aurora-cluster | |
aurora_db_name: ansibled-aurora-a | |
aurora_instance_type: db.t2.small | |
aurora_availability_zone: "{{ aws_region }}a" | |
aurora_promotion_tier: 1 |
This file contains hidden or 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
{ | |
"DBInstanceIdentifier": "{{ aurora_db_name }}", | |
"DBInstanceClass": "{{ aurora_instance_type }}", | |
"Engine": "aurora-mysql", | |
"AvailabilityZone": "{{ aurora_availability_zone }}", | |
"DBSubnetGroupName": "{{ aurora_cluster_name }}-subnets", | |
"PreferredMaintenanceWindow": "mon:11:00-mon:11:30", | |
"MultiAZ": false, | |
"AutoMinorVersionUpgrade": true, | |
"LicenseModel": "general-public-license", |
This file contains hidden or 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
# aurora.yml | |
# --- | |
# playbook that builds Aurora clusters | |
# first run a play for any cluster hosts to create them | |
- hosts: aurora.cluster | |
environment: | |
AWS_ACCESS_KEY_ID: "{{ aws_access_key }}" | |
AWS_SECRET_ACCESS_KEY: "{{ aws_secret_key }}" | |
AWS_REGION: "{{ aws_region }}" |
This file contains hidden or 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
# host_vars/cluster.aurora.ansibled.yml | |
# --- | |
# specific variables for the "auroradb.ansibled" host | |
aurora_cluster_name: ansibled-aurora-cluster | |
aurora_cluster_dns: auroradb.{{ vpc_dns_zone }} | |
# credentials for the master user of our db cluster -- password (ansibled-db-password) encrypted with Ansible Vault | |
aurora_cluster_username: ansibled_db_user | |
aurora_cluster_password: !vault | |
This file contains hidden or 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
# group_vars/aurora.cluster.yml | |
# --- | |
# default variables for hosts in the group for Aurora clusters | |
aurora_cluster_port: 3306 | |
aurora_cluster_security_group_ids: | |
- "{{ vpc_security_group_ids['vpc'] }}" | |
aurora_cluster_availability_zones: |