Skip to content

Instantly share code, notes, and snippets.

View sivel's full-sized avatar
😏

Matt Martz sivel

😏
View GitHub Profile
diff --git a/lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py b/lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py
index 6eb690baed..0fe301a301 100644
--- a/lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py
+++ b/lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py
@@ -56,6 +56,12 @@ options:
default: thin
description:
- Disk provisioning type.
+ enable_hidden_properties:
+ description:
diff --git a/lib/ansible/parsing/ajson.py b/lib/ansible/parsing/ajson.py
index 7444a9f403..36c693dead 100644
--- a/lib/ansible/parsing/ajson.py
+++ b/lib/ansible/parsing/ajson.py
@@ -20,33 +20,27 @@ class AnsibleJSONDecoder(json.JSONDecoder):
_vaults = {}
+ def __init__(self, *args, **kwargs):
+ kwargs['object_hook'] = self.object_hook
@sivel
sivel / cherry-pick-pr.md
Last active August 14, 2018 06:26
Basic workflow for creating a cherry-pick pull request for ansible

After submitting a PR to Ansible for the devel branch, and having it merged, the following instructions will help you create a pull request to backport the change to a previous stable branch

These instructions assume that stable-2.5 is the previous release branch.

  1. Update devel, to ensure you have the commit to cherry pick:

    git checkout devel
    git --fetch upstream
    

git merge upstream/devel

2018/06/13 10:10:05 [INFO] Packer version: 1.2.4
2018/06/13 10:10:05 Packer Target OS/Arch: darwin amd64
2018/06/13 10:10:05 Built with Go Version: go1.10.1
2018/06/13 10:10:05 Detected home directory from env var: /Users/matt
2018/06/13 10:10:05 Using internal plugin for parallels-iso
2018/06/13 10:10:05 Using internal plugin for amazon-chroot
2018/06/13 10:10:05 Using internal plugin for amazon-instance
2018/06/13 10:10:05 Using internal plugin for lxd
2018/06/13 10:10:05 Using internal plugin for null
2018/06/13 10:10:05 Using internal plugin for virtualbox-ovf
diff --git a/lib/ansible/playbook/__init__.py b/lib/ansible/playbook/__init__.py
index 7391414949..0ec3e10e22 100644
--- a/lib/ansible/playbook/__init__.py
+++ b/lib/ansible/playbook/__init__.py
@@ -54,7 +54,7 @@ class Playbook:
pb._load_playbook_data(file_name=file_name, variable_manager=variable_manager)
return pb
- def _load_playbook_data(self, file_name, variable_manager):
+ def _load_playbook_data(self, file_name, variable_manager, vars=None):
@sivel
sivel / sync_container_to_folder.py
Created May 18, 2013 00:08
Sync a remote Rackspace CloadFiles container to a local directory
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Rackspace
# Copyright 2013 Matt Martz
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
@sivel
sivel / memrecap.py
Last active March 26, 2018 17:26
This is an ansible callback plugin that profiles maximum memory usage of ansible per task, and displays a recap at the end
# (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
@sivel
sivel / duration.py
Last active February 27, 2018 20:16
Module for parsing a time duration and returning a float or a timedelta object
# Copyright (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import datetime
import itertools
import re
DURATION_RE = re.compile(
'(?P<sign>[-+]?)(?P<value>[0-9]*(?:\.[0-9]*)?)(?P<unit>[a-z]{1,2})'
)
@sivel
sivel / changelog.py
Last active February 20, 2018 21:24
Simple script that looks for issue/pr references in commit messages, and generates something like a changelog
#!/usr/bin/env python
import os
import re
import mistune # mistune
from github import Github # PyGithub
from argparse import ArgumentParser
# Copyright: 2018, Matt Martz <matt@sivel.net>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause )
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
__all__ = ['Version', 'parse']
try:
from packaging.version import LegacyVersion, Version as Pep440Version, parse