Skip to content

Instantly share code, notes, and snippets.

View jwitko's full-sized avatar

Jason Witkowski jwitko

View GitHub Profile
@jwitko
jwitko / gist:c33d4d01d818cbec49b8db2b53b31637
Last active March 28, 2019 15:08
This is a logstash 6.6 pipeline config for anyone looking to execute ansible playbooks inside a docker container. This config will aggregate the lines of the playbook into a single document in human readable format and output to the message field. The key/value config will also log how many OK, CHANGED, and FAILURES occured.
if "YOUR_ANSIBLE_IMAGE" in [image_name] {
if "PLAY [" in [message] {
mutate {
add_tag => ["PLAY_START"]
}
aggregate {
task_id => "%{container_id}"
code => "map['ansibleLog'] = event.get('message')"
map_action => "create"
@jwitko
jwitko / docker_swarm_service.patch
Created May 18, 2018 21:01
docker_swarm_service.py patch for fixing docker-py integration issues
--- lib/ansible/modules/cloud/docker/docker_swarm_service.py 2018-05-18 17:00:09.828885095 -0400
+++ ../throtle-ansible/library/docker_swarm_service.py 2018-05-18 15:50:15.225333366 -0400
@@ -358,19 +358,22 @@
state: absent
'''
-from ansible.module_utils.docker_common import HAS_DOCKER_PY_2
from ansible.module_utils.docker_common import DockerBaseClass
from ansible.module_utils.docker_common import AnsibleDockerClient
from ansible.module_utils.basic import human_to_bytes
@jwitko
jwitko / docker_swarm_service.py
Created May 18, 2018 19:13
ansible docker_swarm_service module
#!/usr/bin/python
#
# (c) 2017, Dario Zanzico (git@dariozanzico.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
@jwitko
jwitko / errors.json
Created March 15, 2018 21:47
ansible 2.4 ec2_asg_Facts module error
-------------------------------------------------------------------------------------------------
ansible task which produces the error:
-------------------------------------------------------------------------------------------------
- name: ASG | Create Auto Scale Group for Application load balancer
ec2_asg:
name: "{{ deploy_env }}-{{ service }}-{{ swarm_type }}-{{ item.0.item.type|replace('.','-') }}"
health_check_period: "{{ item.1.asg_health_check_period|default(asg_health_check_period) }}"
health_check_type: "{{ item.1.asg_health_type | default(asg_health_type | default(omit)) }}"
launch_config_name: "{{ item.0.name }}"
region: "{{ region }}"
@jwitko
jwitko / keybase.md
Created March 14, 2017 15:08
keybase.md

Keybase proof

I hereby claim:

  • I am jwitko on github.
  • I am jwitkowski (https://keybase.io/jwitkowski) on keybase.
  • I have a public key ASAtbcuYGDi3RHySgOvN3qAU9dz3sramSLtljsUIiZWF6go

To claim this, I am signing this object:

Verifying that +jwitko is my blockchain ID. https://onename.com/jwitko