Skip to content

Instantly share code, notes, and snippets.

sudo apt-get update
sudo apt-get install git python-setuptools python-dev sshpass libffi-dev libssl-dev make libxml2-dev libxslt1-dev acl build-essential -y
sudo easy_install pip
sudo pip install paramiko PyYAML jinja2 httplib2 requests lxml cssselect xmltodict sphinx
sudo pip install pywinrm
sudo pip install requests==2.13.0
sudo pip install packaging
#In order to build docs:
sudo apt-get install asciidoc -y
version: "2"
services:
concoursedb:
image: postgres:9.5
environment:
POSTGRES_DB: concourse
POSTGRES_USER: concourse
POSTGRES_PASSWORD: changeme
PGDATA: /database
@trondhindenes
trondhindenes / usersearch.ps1
Last active May 17, 2017 14:54
Function for verifying local and domain users
Function UserSearch
{
Param ([string]$AccountName)
#Check if there's a realm specified
if ($AccountName.Split("\").count -gt 1)
{
if ($AccountName.Split("\")[0] -eq $env:COMPUTERNAME)
{
$IsLocalAccount = $true
}
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
$jobj = [Newtonsoft.Json.Linq.JObject]::Parse($mystring)
---
- name: Do stuff to stuff
hosts: localhost
tasks:
- name: set fact
set_fact:
thing: otherstuff
- name: first run - no loop
include_role:
name: myrole