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
| > $ ./scaleway-inventory.py --list | |
| { | |
| "infrastructure": { | |
| "children": [ | |
| "scaleway" | |
| ] | |
| }, | |
| "_meta": { | |
| "hostvars": { | |
| "web1": { |
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
| > $ ansible -i scaleway/scaleway-inventory.py all -m debug -a "var=hostvars[inventory_hostname]['ansible_host']" | |
| web1 | SUCCESS => { | |
| "changed": false, | |
| "hostvars[inventory_hostname]['ansible_host']": "10.2.216.145" | |
| } | |
| database1 | SUCCESS => { | |
| "changed": false, | |
| "hostvars[inventory_hostname]['ansible_host']": "10.3.64.213" | |
| } | |
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
| > $ ./dynamic-inventory.py --list | |
| { | |
| "infrastructure": { | |
| "children": [ | |
| "mycloud" | |
| ] | |
| }, | |
| "_meta": { | |
| "hostvars": { |
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
| --- | |
| - hosts: infrastructure | |
| become: true | |
| pre_tasks: | |
| - name: debug | |
| debug: | |
| msg: "{{ hostvars[item] }}" | |
| with_items: "{{ groups['infrastructure'] }}" | |
| ... | |
| ## Invocation: |
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
| - name: Wait for elasticsearch cluster replica shards to be fully allocated for 5 minutes. | |
| uri: | |
| url: http://localhost:9200/_cluster/health?wait_for_no_relocating_shards=true&timeout=5s | |
| return_content: true | |
| register: elasticsearch_cluster_health | |
| until: elasticsearch_cluster_health.json.status == "green" | |
| retries: 100 | |
| when: groups['elasticsearch']|length > 1 | |
| environment: | |
| http_proxy: '' |
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
| org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: | |
| General error during class generation: Method code too large! | |
| java.lang.RuntimeException: Method code too large! | |
| at groovyjarjarasm.asm.MethodWriter.a(Unknown Source) | |
| at groovyjarjarasm.asm.ClassWriter.toByteArray(Unknown Source) | |
| at org.codehaus.groovy.control.CompilationUnit$17.call(CompilationUnit.java:827) | |
| at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065) | |
| at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603) | |
| at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581) |
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
| provider "aws" { | |
| version = "~> 1.9" | |
| region = "eu-central-1" | |
| } | |
| resource "aws_kms_key" "mykey" { | |
| description = "This key is used to encrypt bucket objects" | |
| deletion_window_in_days = 10 | |
| } | |
| resource "aws_s3_bucket" "mybucket" { |
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
| #!/bin/sh | |
| export VAULT_ADDR="https://active.vault.service.consul:8200" | |
| export VAULT_PKI_PATH="v1/pki/issue/application" | |
| # Getting a GCP JWT to authenticate against Vault GCP auth backend | |
| JWT_TOKEN=$(curl -s -H "Metadata-Flavor: Google" 'http://metadata/computeMetadata/v1/instance/service-accounts/someserviceaccount/identity?audience=vault/apps&format=full') | |
| # Getting a short lived Vault authentication token payload | |
| until VAULT_TOKEN_PAYLOAD=$(curl -sfk -X POST ${VAULT_ADDR}/v1/auth/gcp/login -d " |
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
| resource "google_container_cluster" "primary" { | |
| name = "primary" | |
| region = "europe-west1" | |
| remove_default_node_pool = true | |
| initial_node_count = 1 | |
| ip_allocation_policy { | |
| cluster_secondary_range_name = "10.0.0.0/16" | |
| services_secondary_range_name = "10.1.0.0/16" |
OlderNewer