Skip to content

Instantly share code, notes, and snippets.

View resmo's full-sized avatar
:octocat:

René Moser resmo

:octocat:
View GitHub Profile
@resmo
resmo / sync.sh
Created September 11, 2015 07:10
#!/bin/bash
cp ../ansible-modules-extras/cloud/cloudstack/cs_*.py .
str='from ansible.module_utils.cloudstack import *'
for i in $(ls cs_*.py); do
sed -i -e "/$str/r ansible_cloudstack_utils.py" -e "/$str/d" $i
done
@resmo
resmo / timeout.py
Created January 13, 2016 19:56
shows a timer counting down in a window using tinker
#!/usr/bin/python
import Tkinter as tk
import time
class App():
def __init__(self):
self.timer = 60
self.root = tk.Tk()
self.label = tk.Label(text="")
self.label.pack()
- hosts: localhost
gather_facts: no
tasks:
- name: copy an ssl cert
shell: echo cert has been changed
notify:
- hosts: localhost
gather_facts: no
handlers:
---
- hosts: localhost
connection: local
tasks:
- name: foobar
shell: echo foobar
notify: event_foobar
handlers:
$ cat hosts
foo
$ cat test.yml
---
- hosts: foo
connection: local
gather_facts: no
Using /home/resmo/Projects/swisstxt/ansible-swisstxt/ansible.cfg as config file
ERROR! Unexpected Exception: too many values to unpack
the full traceback was:
Traceback (most recent call last):
File "/home/resmo/Projects/resmo/ansible/bin/ansible-playbook", line 97, in <module>
exit_code = cli.run()
File "/home/resmo/Projects/resmo/ansible/lib/ansible/cli/playbook.py", line 132, in run
inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list=self.options.inventory)
File "/home/resmo/Projects/resmo/ansible/lib/ansible/inventory/__init__.py", line 91, in __init__
$ cs listProjects --region ma-cloud
{
"count": 1,
"project": [
{
"account": "moserre",
"cpuavailable": "39",
"cpulimit": "40",
"cputotal": 1,
"displaytext": "web",
- block:
- include: "{{ fname }}.yml"
when: fname != ""
- block:
- include: foo.yml
- include: bla.yml
when: fname == ""
---
- hosts: localhost
gather_facts: yes
tasks:
- name: extract new templates
local_action:
module: cs_template
name: my template
state: extracted
api_region: first region
one
two
three
four
five
six