Skip to content

Instantly share code, notes, and snippets.

[WARNING]: Using a variable for a task's 'args' is unsafe in some situations (see https://docs.ansible.com/ansible/devel/reference_appendices/faq.html#argsplat-unsafe)
fatal: [localhost]: FAILED! => {
"changed": false
}
MSG:
Unsupported parameters for (ec2_ami_info) module: warn Supported parameters include: aws_access_key, aws_secret_key, debug_botocore_endpoint_logs, describe_image_attributes, ec2_url, executable_users, filters, image_ids, owners, profile, region, security_token, validate_certs
- stat:
path: /path/to/something
register: output
- debug:
var: output
@boxrick
boxrick / api.py
Created May 18, 2020 23:15
Azure Devops - Python API - Simple request example
import requests
from requests.auth import HTTPBasicAuth
import logging
import sys
import json
def getApi(uri, token):
try:
resp = requests.get(uri,auth=HTTPBasicAuth('',token))
parsed = json.loads(resp.text)
@boxrick
boxrick / Config
Created February 6, 2019 16:02
GKE Container Native HTTPS
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: website
labels:
app: website
spec:
replicas: 1
template:
@boxrick
boxrick / image-cleanup.sh
Created October 29, 2018 17:59
Script to cleanup Google Cloud - GCP - virtual machine images based on project and number of desired images
#!/bin/bash
# Script to cleanup GCP virtual machine images
# How many images of this family do we wish to retain
desired_images=8
image_project="PROJECTHERE"
clean_images()
{
# Function to clean up images, set the default family to megatron base
@boxrick
boxrick / travis.yml
Created October 26, 2018 10:37
Travis Build
language: python
sudo: true
# Install required packages for build
addons:
apt:
packages:
- unzip
- curl
# Only trigger on Master branch
@boxrick
boxrick / stats
Created October 9, 2018 10:33
Get stats
#!/bin/bash
# Small script to check max processes and apache max memory usage
max_mem=0
max_processes=0
file_store='./max_values.txt'
touch $file_store
source $file_store
cleanup ()
{
@boxrick
boxrick / clone
Created September 13, 2018 00:24
But of python taken and modified to fix, clones all repos from an org, matching on name then prints the list
#!/usr/bin/env python
import pygithub3
import re
gh = None
def gather_clone_urls(organization, no_forks=True):
all_repos = gh.repos.list_by_org(organization,type='all').all()
for repo in all_repos:
- name: Download cleanup script from github
win_get_url:
url: https://raw.githubusercontent.com/Disassembler0/Win10-Initial-Setup-Script/master/Win10.ps1
dest: c:\Temp\w10setup\Win10.ps1
force: no
- name: Disable Web Search
win_regedit:
path: HKLM:\ANSIBLE\SOFTWARE\Microsoft\Windows\CurrentVersion\Search
name: "{{ item.name }}"
data: "{{ item.data }}"
type: dword
state: present
hive: C:\Users\Default\NTUSER.dat
loop:
- name: BingSearchEnabled