Skip to content

Instantly share code, notes, and snippets.

View fischerdr's full-sized avatar
:octocat:

David R. Fischer fischerdr

:octocat:
View GitHub Profile

Ansible Development Standards

Document Version: 1.0.0
Last Updated: 2025-02-10
Target Audience: Mid-level engineers developing enterprise Ansible automation
Purpose: Core standards for production-grade Ansible roles, playbooks, and custom modules


Table of Contents

@fischerdr
fischerdr / build_localai_rocm.sh
Last active July 11, 2025 15:16
Build script to try to build LocalAI from source for ROCm gfx1151
#!/bin/bash
# Logging setup
LOG_FILE="localai_rocm_build_$(date +%Y%m%d_%H%M%S).log"
LOG_DIR="logs"
# Create logs directory if it doesn't exist with proper permissions
mkdir -p "$LOG_DIR" 2>/dev/null || {
echo "Error: Cannot create log directory $LOG_DIR"
exit 1
@fischerdr
fischerdr / distrobox_fedora_playwright.md
Created June 6, 2025 14:56 — forked from pskopek/distrobox_fedora_playwright.md
Playwright compatible distrobox setup on Fedora 41

Setup on Fedora 41 (or other not supported Linux distro)

Playwright doesn't support Fedora distribution. Following is a description how to run the tests using Ubuntu 22.04 image using distrobox which is fairy supported on various Linux distributions.

Install distrobox and podman packages

sudo dnf install distrobox podman
@fischerdr
fischerdr / Ansiblevault-migrationguide.md
Created March 7, 2025 02:28
Ansiblevault-migrationguide.md

Migration Guide: Implementing HashiCorp Vault Security with Ansible

Introduction

This document provides a structured approach for migrating from an unsecured Ansible environment to one that implements the comprehensive security practices outlined in our "Security Guidelines for Using HashiCorp Vault with Ansible Playbooks" document. This guide is designed for organizations that need to transition from legacy automation practices with minimal security controls to a robust, secure integration between Ansible and HashiCorp Vault.

Purpose and Scope

This migration guide is intended for:

@fischerdr
fischerdr / SecurityGuidelines-ansiblevault.md
Created March 7, 2025 02:27
SecurityGuidelines-ansiblevault.md

Security Guidelines for Using HashiCorp Vault with Ansible Playbooks

Introduction

This comprehensive security guide provides detailed best practices for integrating HashiCorp Vault with Ansible automation workflows in enterprise environments. As organizations increasingly adopt Infrastructure as Code (IaC) approaches, the secure management of secrets becomes critical to maintaining robust security postures while enabling automation.

HashiCorp Vault serves as a centralized secrets management platform that, when properly configured with Ansible, creates a secure and scalable solution for managing credentials, certificates, API keys, and other sensitive information across diverse infrastructure environments. This document addresses the complete security lifecycle of this integration, from initial architecture design to ongoing operational security.

Purpose and Scope

import requests
import json
import sys
import logging
import click
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
@fischerdr
fischerdr / vault_traversal.py
Last active January 16, 2025 01:14
pip install hvac click ; python vault_traversal.py --url https://vault.example.com --token mytoken --path secret/ --namespace space
import hvac
import os
import click
import logging
from typing import Optional, List, Dict, Any, Union
from pick import pick
# Configure logging with more detailed format
logging.basicConfig(
level=logging.DEBUG, # Set to DEBUG level for more detailed information
@fischerdr
fischerdr / k8s_check_labels.yml
Last active December 10, 2024 15:22
ansible playbook to look for namespace default label and assigns extra labels for backup schedules
---
- name: Check_and_update
hosts: localhost
gather_facts: false
vars:
inital_label: "label_a"
storage: "label_b"
resrcs_only: "label_c"
full_namespace: "label_d"
schedule_names:
---
- name: Manage Kubernetes Resources
hosts: localhost
gather_facts: false
vars:
namespace: my-namespace # Replace with your namespace
service_account_name: my-service-account # Replace with your service account name
cluster_role_name: pxbackup-sa-clusterrolebinding
sa_role_name: pxbackup-sa-clusterrolebinding
sa_role_binding_name: pxbackup-sa-rolebinding
import os
import logging
import hvac
from argparse import ArgumentParser
def setup_logging():
"""Set up the logging configuration."""
logging.basicConfig(
level=logging.INFO,