Skip to content

Instantly share code, notes, and snippets.

@perzizzle
perzizzle / deploy.ps1
Last active August 29, 2015 14:08
Splattering test
param(
[Parameter(Mandatory=$false,Position=1)] [hashtable] $installArguments = @{}
)
Write-Host "Install Arguments: $installArguments"
@perzizzle
perzizzle / output.txt
Created December 8, 2014 15:40
Unzip output
PLAY [JenkinsTest] ************************************************************
GATHERING FACTS ***************************************************************
ok: [mdl-wsrv98]
ok: [mdl-wsrv99]
TASK: [Unzip deploy tools] ****************************************************
failed: [mdl-wsrv98 -> 127.0.0.1] => {"check_results": {"unarchived": false}, "dest": "/home/mperzel/deploy/", "extract_results": {"cmd": "/usr/bin/unzip -o \"/home/mperzel/deploy.zip\" -d \"/home/mperzel/deploy/\"", "err": "warning: /home/mperzel/deploy.zip appears to use backslashes as path separators\n", "out": "Archive: /home/mperzel/deploy.zip\n inflating: /home/mperzel/deploy/deploy.ps1 \n inflating: /home/mperzel/deploy/deploylauncher.ps1 \n inflating: /home/mperzel/deploy/servers.json \n inflating: /home/mperzel/deploy/startDeployLauncher.ps1 \n inflating: /home/mperzel/deploy/common/LoadCommon.ps1 \n inflating: /home/mperzel/deploy/common/Surescripts.Certificate.ps1 \n inflating: /home/mperzel/deploy/common/Suresc
@perzizzle
perzizzle / main.yml
Last active August 29, 2015 14:11
main.yml Unzip test
---
- name: UnzipTest
hosts: linux
tasks:
- name: Unzip deploy tools
unarchive: src=/home/mperzel/deploy.zip dest=/home/mperzel/deploy/ copy=no #group=awx owner=awx mode=2770 copy=no
delegate_to: 127.0.0.1
run_once: true
@perzizzle
perzizzle / main.yml
Last active August 29, 2015 14:15
ToPowershellHash
# Test toPowershellHash filter
# (c) 2015, Michael Perzel
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@perzizzle
perzizzle / main.yml
Last active August 29, 2015 14:15
ToPowershellHash Variables
# Parameters to pass to test scripts.
test_powershell_hash_filter_value:
This: THIS
That: THAT
Other: OTHER
test_powershell_hash_filter_expected: "@{This=THIS;Other=OTHER;That=THAT;}"
test_powershell_hash_filter_value_invalid:
- This
@perzizzle
perzizzle / windows.py
Last active August 29, 2015 14:15
ToPowershellHash filter
import yaml
from ansible import errors
def toPowershellHash(x):
try:
powershell ="@{"
if isinstance(x, dict):
for key, value in x.items():
powershell += "'{0}'='{1}';".format(key,value)
@perzizzle
perzizzle / main.yml
Last active August 29, 2015 14:16
Unzip ansible module test
# Test unzip module
# (c) 2015, Michael Perzel <michaelperzel@gmail.com>
- name: Unzip test file
win_unzip:
src=C:\file.zip
dest=C:\
register: unzip_output
- name: Gather win_stat on parentFolder
@perzizzle
perzizzle / tower-cli.py
Created February 26, 2015 20:19
Ansible module to run tower-cli
#!/usr/bin/python
DOCUMENTATION = '''
---
module: tower-cli
short_description: Trigger ansible tower jobs from ansible tower
description:
- Use tower-cli to trigger jobs
options:
@perzizzle
perzizzle / settings.py
Created April 2, 2015 03:03
LDAP logging section of settings.py
###############################################################################
# LOGGING SETTINGS
###############################################################################
LOGGING['handlers']['syslog'] = {
'level': 'DEBUG',
'filters': ['require_debug_false'],
'class': 'logging.handlers.SysLogHandler',
'address': '/dev/log',
'facility': 'local0',
---
- name: Hello World Linux
hosts: "{{ host_limit }}"
gather_facts: false
tasks:
- name: Hello World Linux
shell: echo "hello world"
when: message is not defined