Skip to content

Instantly share code, notes, and snippets.

View a-nldisr's full-sized avatar
📺
Pipe it to bash

Rogier Dikkes a-nldisr

📺
Pipe it to bash
View GitHub Profile
- name: 'Verify if directories already exists'
stat:
path: "{{ playbook_dir }}/roles/{{ new_role_name }}/{{item.dest}}"
register: folder_stats
loop:
- { dest: "tasks" }
- { dest: "templates" }
- { dest: "defaults" }
- { dest: "handlers" }
- name: 'Register Test VPC into a var'
ec2_vpc_net_facts:
filters:
"tag:Name": test-vpc
register: vpctest
# You probably need to change the IP for something at your side
- name: 'Creating Customer Gateway'
ec2_customer_gateway:
- name: set up VPN with tunnel options utilizing 'TunnelInsideCidr' only
ec2_vpc_vpn:
state: present
filters:
vpn: vpn-XXXXXXXX
static_only: true
tunnel_options:
-
TunnelInsideCidr: '169.254.100.1/30'
-
#!/bin/bash
cat >> ./file1.text <<EOF
YOUR_NAME: '$RELEASE_NAME'
YOUR_ADDR: '$RELEASE_NAMESPACE'
EOF
cat >> ./file2.text <<EOF
MY_NAME: '$RELEASE_NAME'
MY_ADDR: '$RELEASE_NAMESPACE'
{
"id": "/prometheus/node-exporter",
"acceptedResourceRoles": [
"*"
],
"backoffFactor": 1.15,
"backoffSeconds": 1,
"cmd": "node_exporter-0.17.0.linux-amd64/node_exporter --collector.systemd --collector.interrupts --web.listen-address :$PORT0",
"constraints": [
[
# This triggers the s3-backup you configure in your percona universe task, the dcos cli basically performs this call. With this you can configure a jenkins or other task to perform a weekly backup
curl -H 'Accept-encoding: gzip' -H "Content-Type: application/json" -H "Authorization: token=${MY_TOKEN}" -X POST https://master.mesos/service/percona-server-mongodb/v1/plans/backup-s3/start -d "{ }"
[Unit]
Description=vault server
Documentation=https://vaultproject.io/docs/
After=network.target
ConditionFileNotEmpty=/etc/vault/vault-config.hcl
[Service]
User=vault
Group=vault
PrivateDevices=yes
# Generate the elastic IP for the loadbalancer
resource "aws_eip" "test-lb" {
vpc = true
lifecycle {
create_before_destroy = "true"
}
}
# Generate the target group for the load balancer to use
resource "aws_lb_target_group" "test-lb-tg" {
https://t.co/z1xdVVioMh?amp=1
@a-nldisr
a-nldisr / fileserver.aurora
Created November 15, 2016 11:38
Apache Aurora .aurora file example for starting a Go fileserver that copy a remote swift container to a local filesystem. In this i was playing around with task combining, task concat and Sequential tasks
# --- templates and variables ---
class Profile(Struct):
web_version = Default(String, '0.0.5')
rclone_version = Default(String, '0.0.9')
parent_environment = Default(String, 'test')
instances = Default(Integer, 2)
cluster = Default(String, 'one')
role = Default(String, 'test')
environment = Required(String)