Skip to content

Instantly share code, notes, and snippets.

{
"beat": {
"cpu": {
"system": {
"ticks": 62,
"time": 62
},
"total": {
"ticks": 155,
"time": 155,
@trondhindenes
trondhindenes / site.yml
Created March 25, 2018 08:28
example of using the mssql role to provision RDS databases
- name: do sql things
hosts: sqlserver_jumphost
tasks:
- name: doit
include_role:
name: rikstv_windows_mssqlconfig
vars:
admin_login: "superduperadmin"
admin_password: "superduperpassword"
sql_server_name: "super-duper-mssql01.eu-west-1.rds.amazonaws.com"
@trondhindenes
trondhindenes / main.yml
Created March 25, 2018 08:23
MSSQL config ansible role
- name: Create MSSQL Logins
win_dsc:
resource_name: SqlServerLogin
Ensure: "{{ item['state'] | default('present')}}"
LoginType: "SqlLogin"
ServerName: "{{ sql_server_name }}"
Name: "{{ item['username'] }}"
InstanceName: MSSQLSERVER
LoginCredential_username: "{{ item['username'] }}"
LoginCredential_password: "{{ item['password'] }}"
@trondhindenes
trondhindenes / handler.py
Created February 12, 2018 15:38
Stuff you need for x-ray with Python in lambda
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core import patch_all
patch_all()
def handler(event, context):
return 'blarg'
version: "2"
services:
concoursedb:
image: postgres:9.5
environment:
POSTGRES_DB: concourse
POSTGRES_USER: concourse
POSTGRES_PASSWORD: changeme
PGDATA: /database
Set-WindowsExplorerOptions -EnableShowFileExtensions
choco install googlechrome
choco install notepadplusplus
choco install git.install -params '"/GitOnlyOnPath"'
choco install cmder
choco install visualstudiocode -params '"/NoDesktopIcon /NoContextMenuFiles /NoQuicklaunchIcon"'
choco install keepass.install
choco install winscp.install
choco install firefox
#!/usr/bin/env python
import os
import rethinkdb
import json
import rethinkdb as r
from os import listdir
from os.path import isfile, join
- name: Set intermediate fact
set_fact:
vars_hack: "{{ hostvars[inventory_hostname] }}"
- name: remove temp folder
file:
path: "/tmp/ansiblecmdb"
state: absent
failed_when: false
delegate_to: localhost
- name: copy custom facts file
win_copy:
src: softwarefacts.ps1
dest: "C:\\Scripts\\facts"
- name: gather extra facts
setup:
fact_path: "C:\\Scripts\\facts"
$packages = Get-WmiObject -Class Win32_Product
$returnpackages = @()
foreach ($package in $packages)
{
$PackageObj = "" | Select Name, IdentifyingNumber, Version, Caption
$PackageObj.Name = $Package.Name
$PackageObj.IdentifyingNumber = $Package.IdentifyingNumber
$PackageObj.Version = $Package.Version
$PackageObj.Caption = $Package.Caption
$returnpackages += $PackageObj;$PackageObj = $null