Skip to content

Instantly share code, notes, and snippets.

@azaghal
azaghal / test-apt-repository.yml
Created August 1, 2018 11:00
Simple demo playbook using apt_repository ("duplicate" entries)
- hosts: xmpp
remote_user: ansible
become: yes
tasks:
- name: Add Prosody repository
apt_repository:
repo: "deb http://packages.prosody.im/debian jessie main"
state: present
@azaghal
azaghal / test_socket.py
Created May 24, 2018 17:33
testinfra Socket demo
def test_unix_socket(host):
socket_path = "/tmp/mytestsocket"
unix_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
unix_socket.bind(socket_path)
unix_socket.listen(1)
test_socket = host.socket("unix://%s" % socket_path)
assert test_socket.is_listening
@azaghal
azaghal / django-wiki-code.txt
Created February 13, 2017 22:42
Minimal sample to produce weird code numbering issues in Django Wiki
#!/bin/sh
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
---
- hosts: managed
remote_user: ansible
become: yes
tasks:
- template: src="hostinfo.j2" dest="/tmp/hostinfo"