Skip to content

Instantly share code, notes, and snippets.

View chrrrles's full-sized avatar

Chrrrles Paul chrrrles

  • Hong Kong
View GitHub Profile
# -*- encoding: utf-8 -*-
import string
import yaml
from yaml import Loader, SafeLoader
# From Cryo http://stackoverflow.com/a/2967461
def construct_yaml_str(self, node):
return self.construct_scalar(node)
preamble = """# Copyright (c) 2013 - The C3PX authors.
#
# This file is part of C3PX.
#
# C3PX is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# C3PX is distributed in the hope that it will be useful,
---
- name: test float values with lvol
sudo: yes
remote_user: user
hosts: all
vars:
img: /tmp/lvol_test.img
tasks:
- name: create loop image
shell: dd if=/dev/zero of={{ img }} bs=1M count=100
[root@a830ca3bdcaa working]# rpm-ostree-toolbox imagefactory -c fedora-atomic/config.ini -i kvm -i raw --ostreerepo /srv/rpm-ostree/fedora-atomic/23/ -o /srv/rpm-ostree/fedora-atomic/23/images
/usr/lib64/rpm-ostree-toolbox/py/rpmostreecompose/imagefactory.py:29: PyGIWarning: OSTree was imported without specifying a version first. Use gi.require_version('OSTree', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import Gio, OSTree, GLib # pylint: disable=no-name-in-module
/usr/lib64/rpm-ostree-toolbox/py/rpmostreecompose/taskrunner.py:27: PyGIWarning: GSystem was imported without specifying a version first. Use gi.require_version('GSystem', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib,Gio,GSystem # pylint: disable=no-name-in-module
No kickstart was passed with -k and /home/working/fedora-atomic/fedora-atomic-f23.ks does not exist
@chrrrles
chrrrles / jinja equalto test
Created February 1, 2017 08:42
How to use jinja select and filter in ansible
# test.yml
---
- hosts: localhost
connection: local
gather_facts: no
vars:
my_list:
- one
- two
- three
---
- hosts: all
tasks:
- add_host:
name: 10.10.22.22
groups: test_group
- command: echo 'this command will not connect to 10.10.22.22'
- hosts: all
tasks: