Skip to content

Instantly share code, notes, and snippets.

View mohag's full-sized avatar

Gert van den Berg mohag

View GitHub Profile
@mohag
mohag / gcs_region_tasks.yaml
Created July 29, 2024 14:00
GCS bucket region detection from Ansible (from a GCP host)
- name: Since we don't have a region for GCP, get the token from the metadata service
ansible.builtin.uri:
url: "http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token"
headers:
Metadata-Flavor: Google
Accept: "application/json"
return_content: yes
register: gcp_token
- name: Fetch the region for the bucket from the GCS API
@mohag
mohag / aws_eks.py
Created May 7, 2024 14:29
AWS EKS inventory plugin for Ansible
# -*- coding: utf-8 -*-
# Copyright (c) 2024 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Derived from the aws_rds inventory plugin
DOCUMENTATION = r"""
name: aws_eks
short_description: EKS cluster inventory source
@mohag
mohag / cluster-manifest.yaml
Last active June 27, 2019 14:58
Cluster manifest for KOPS issue
kind: Cluster
metadata:
creationTimestamp: 2019-06-27T13:58:33Z
name: dev-qa.k8s.domain.com
spec:
additionalPolicies:
node: |
[
{
"Effect": "Allow",
@mohag
mohag / aliases_parse.c
Created January 13, 2012 06:22
DMA aliases_parse.c - gcc -D output on Solaris 10
# 1 "aliases_parse.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "./dfcompat.h" 1