Skip to content

Instantly share code, notes, and snippets.

View mattymo's full-sized avatar

Matthew Mosesohn mattymo

View GitHub Profile
@mattymo
mattymo / yaml_ordered.py
Last active September 29, 2019 11:02 — forked from willmerae/yaml_ordered.py
Ansible inventory plugin that preserves the order of hosts in a host group
# Copyright (c) 2017 Ansible Project
# 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
import os
from collections import MutableMapping
from yaml.nodes import MappingNode