Skip to content

Instantly share code, notes, and snippets.

View TomaszKlosinski's full-sized avatar
💭
#StandWithUkraine 🇺🇦

Tomasz Klosinski TomaszKlosinski

💭
#StandWithUkraine 🇺🇦
View GitHub Profile
@TomaszKlosinski
TomaszKlosinski / Dockerfile
Created May 16, 2017 09:37
Dockerfile for a systemd based docker image.
FROM fedora:rawhide
MAINTAINER “Dan Walsh” <dwalsh@redhat.com>
ENV container docker
RUN yum -y update; yum clean all
RUN yum -y install systemd; yum clean all;
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done);
rm -f /lib/systemd/system/multi-user.target.wants/*;
rm -f /etc/systemd/system/*.wants/*;
rm -f /lib/systemd/system/local-fs.target.wants/*;
rm -f /lib/systemd/system/sockets.target.wants/*udev*;
@TomaszKlosinski
TomaszKlosinski / playbook.yml
Created May 16, 2017 09:40
Ansible playbook with pre-tasks to limit docker container to run only systemd and journald
---
- hosts: all
pre_tasks:
- name: upgrade all packages
yum:
name: '*'
state: latest
- name: install systemd
yum:
@TomaszKlosinski
TomaszKlosinski / .travis.yml
Created May 16, 2017 09:41
Travis CI configuration file to test ansible roles on docker containers using molecule
---
sudo: required
language: python
services:
- docker
before_install:
@TomaszKlosinski
TomaszKlosinski / molecule.yml
Created May 16, 2017 12:33
Molecule configuration for testing Ansible role of a systemd-based service in a docker container
---
dependency:
name: galaxy
driver:
name: docker
docker:
containers:

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@TomaszKlosinski
TomaszKlosinski / pedantically_commented_playbook.yml
Created July 11, 2018 07:52 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@TomaszKlosinski
TomaszKlosinski / keybase.md
Last active December 8, 2018 17:54
keybase.md

Keybase proof

I hereby claim:

  • I am TomaszKlosinski on github.
  • I am tomaszklosinski (https://keybase.io/tomaszklosinski) on keybase.
  • I have a public key whose fingerprint is F7E0 D5E0 352D 9BA9 13EB 845F E625 2FC0 6087 ED6F

To claim this, I am signing this object:

"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
@TomaszKlosinski
TomaszKlosinski / playbook.yml
Created May 9, 2019 14:48
Run Ansible task host by host
- name: start and enable rabbitmq (run task host by host)
service:
name: "rabbitmq-server"
state: "started"
enabled: true
delegate_to: "{{ item }}"
with_items: "{{ groups['rabbitmq'] }}"
run_once: true
@TomaszKlosinski
TomaszKlosinski / circle.yml
Created May 16, 2017 09:42
CircleCI configuration file to test ansible roles on docker containers using molecule
---
machine:
python:
version: 2.7.10
services:
- docker
dependencies:
pre: