Skip to content

Instantly share code, notes, and snippets.

View sivel's full-sized avatar
😏

Matt Martz sivel

😏
View GitHub Profile
@danmack
danmack / alpine-podman-rootless.md
Last active September 1, 2024 03:45
Podman Rootless on Alpine Linux

How to do rootless Podman on Alpine Linux

Using recent podman (3.x) on 5.10.x Alpine Linux Kernels

apk add podman util-linux

enable and start the cgroups and podman services

@sivel
sivel / make_manifest.py
Last active May 25, 2022 06:49
Script to create a MANIFEST.json and FILES.json for an Ansible collection from galaxy.yml
#!/usr/bin/env python
# Copyright (c) 2020 Matt Martz <[email protected]>
# GNU General Public License v3.0+
# (see https://www.gnu.org/licenses/gpl-3.0.txt)
import json
import os
from ansible.galaxy.collection import _build_files_manifest
from ansible.galaxy.collection import _build_manifest
@abadger
abadger / gist:f588eb169a7040a6a2e36c09b0e2d5a7
Last active September 15, 2023 22:14
Thoughts on building ansible community package
= How are we going to build this? =
We’re only building a single ACD release at a time. So each release will target the latest ansible-standard-lib and the latest collections which used to be in Core.
Ansible-standard-lib currently targets new minor releases every three weeks and new major releases every six months. The proposal is that ACD will release on roughly the same schedule but lag the ansible-standard-lib releases. So, it would be roughly ansible-standard-lib-2.10.1 is released and acd-2.10.1 would follow in 1 to 3 weeks.
Major releases possibly pose more serious problems. If we are not branching and testing against the new release, then there is the potential that when we switch CI over to the new ansible-standard-lib major release, things will break in more major ways. So, we will likely lag major releases by more than the normal 3 weeks. We will also not be able to put out new releases for the old stable ansible during this time if we are only working from a single branch and testing a
@sivel
sivel / 00-include_until.yml
Last active March 15, 2024 08:17
Ansible Include Until
---
- hosts: localhost
gather_facts: false
tasks:
- include_tasks: include_me.yml
vars:
include_max: 10

Draft

Using to_bytes/to_native/to_text

errors

The default value for errors, although specified as None in the function signature is surrogate_then_replace

The most common and recommended values for compatibility between python2

@sivel
sivel / with2loop.yml
Last active February 4, 2020 22:12
Ansible playbook showcasing conversion from with_X loops to loop using filters instead of lookup
---
- name: Playbook showcasing conversion from with_X loops to loop+filters
hosts: localhost
gather_facts: false
vars:
items:
-
- foo
-
- bar
@abadger
abadger / basic.rst
Last active October 17, 2018 17:13
categorization of basic.rst

For the glossary:

distribution
In some operating systems, the kernel of the OS is produced by one organization but this is combined with other necessary tools by a second organization. This second organization is called a distribution.
native string
Python2 and Python3 have different types for unadorned string literals and many strings operations. In Python2, these are byte strings. In Python3,
@cchurch
cchurch / ratelimit.py
Created August 5, 2015 15:03
Ansible callback plugin example for rate limiting tasks
# Python
import time
class CallbackModule(object):
'''
Delay after Rackspace DNS API requests to avoid rate limit (20/minute).
'''
def _rate_limit(self):
role_name = getattr(getattr(self, 'task', None), 'role_name', '')