Skip to content

Instantly share code, notes, and snippets.

@camaeel
camaeel / tasks.yaml
Created May 6, 2025 06:29
ansible configure docker cli
- name: create ~/.docker/config.json file
copy:
content: "{}"
dest: ~/.docker/config.json
force: false
- name: Load file
ansible.builtin.slurp:
src: ~/.docker/config.json
@camaeel
camaeel / Dockerfile
Created January 3, 2025 09:38
Run Golang lambda locally within container
FROM alpine AS lambdarie
RUN apk add curl && \
mkdir -p /.aws-lambda-rie && \
curl -Lo /.aws-lambda-rie/aws-lambda-rie https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64 && \
chmod +x /.aws-lambda-rie/aws-lambda-rie
FROM golang:1.23 AS builder
ADD go.mod go.sum /app/
@camaeel
camaeel / ansible-apt-repo.yml
Created August 18, 2024 20:13
Ansible apt repo "new way"
- name: Add repos
deb822_repository:
name: "{{ item.name }}"
types: "{{ item.repo.split()[0] }}"
uris: "{{ item.repo.split()[1] }}"
suites: "{{ item.repo.split()[2] }}"
components: "{{ item.repo.split()[3] }}"
architectures: "{{ item.architecture | default(omit) }}"
signed_by: "{{ item.key }}"
loop:
@camaeel
camaeel / template-restore.yml
Created February 27, 2024 20:33
Template of helm chart to restore cnpg
---
# Source: example-app/charts/cnpgdb/templates/backup-sa.yml
apiVersion: v1
kind: ServiceAccount
metadata:
name: example-app-cnpgdb-db-backup-aws-creds
---
# Source: example-app/templates/service.yaml
apiVersion: v1
kind: Service
```
apiVersion: v1
items:
- apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"postgres-operator.crunchydata.com/v1beta1","kind":"PostgresCluster","metadata":{"annotations":{},"name":"demo","namespace":"test-crunchy-pgsql"},"spec":{"backups":{"pgbackrest":{"repos":[{"name":"repo1","volume":{"volumeClaimSpec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}},"storageClassName":"nas-nfs-ephemeral"}}}]}},"instances":[{"containers":[{"name":"postgres-startup","securityContext":{"seccompProfile":{"type":"RuntimeDefault"}}},{"name":"database","securityContext":{"seccompProfile":{"type":"RuntimeDefault"}}},{"name":"nss-wrapper-init","securityContext":{"seccompProfile":{"type":"RuntimeDefault"}}},{"name":"replication-cert-copy","securityContext":{"seccompProfile":{"type":"RuntimeDefault"}}}],"dataVolumeClaimSpec":{"accessModes":["ReadWriteOnce"],"resources"
@camaeel
camaeel / go.mod
Last active September 27, 2022 14:41
HC vault issue with NewTestCluster
module dummy
go 1.19
require github.com/hashicorp/vault v1.11.3
require (
cloud.google.com/go v0.102.1 // indirect
cloud.google.com/go/compute v1.7.0 // indirect
cloud.google.com/go/iam v0.3.0 // indirect
@camaeel
camaeel / generate_cert.sh
Last active September 10, 2022 10:55
Running HA vault in k8s with encryption
#!/bin/bash
set -e
NAMESPACE=vault
SERVICE=vault
DIRECTORY=certs
CSR_NAME=vault
SECRET_NAME=vault-server-tls