Skip to content

Instantly share code, notes, and snippets.

View dmsimard's full-sized avatar

David Moreau Simard dmsimard

View GitHub Profile
@dmsimard
dmsimard / mitigate-meltdown.yml
Created January 9, 2018 16:19 — forked from mnaser/mitigate-meltdown.yml
Ansible playbook for Meltdown mitigation (KPI for CentOS/RHEL 7)
---
- hosts: all
gather_facts: false
pre_tasks:
- name: ensure ipmi tools are installed
yum:
name: ipmitool
- name: retrieve ipmitool address
shell: >
ipmitool lan print | grep '^IP Addr' | grep -v Source | cut -d':' -f2 | xargs
@dmsimard
dmsimard / playbook.yml
Last active February 16, 2021 17:23
Installing ara with ansible
- name: Install ara with ansible
hosts: localhost
gather_facts: yes
tasks:
- name: Install ara for the current user
command: "{{ ansible_python }} -m pip install ara[server]"
- name: Get path to the ara callback plugin
command: "{{ ansible_python }} -m ara.setup.callback_plugins"
register: _callback_plugins
@dmsimard
dmsimard / deps-to-galaxy.py
Last active February 2, 2021 02:27
deps to galaxy requirements.yml
#!/usr/bin/env python3
import argparse
import yaml
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--depsfile", help="Path to the ansible.deps file", required=True)
args = parser.parse_args()
return args
#!/bin/bash
# Proof of concept of running playbooks in AWX and recording them in ARA
# From a vanilla CentOS8 image: https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-GenericCloud-8.1.1911-20200113.3.x86_64.qcow2
# Add local bin directory to PATH so we can use things installed with "pip install --user"
export PATH=$PATH:~/.local/bin
dnf -y update
# Install Ansible and Python3
@dmsimard
dmsimard / browser.py
Created January 12, 2021 19:55
Ansible browser module
#!/usr/bin/python3
# Copyright: (c) 2021, David Moreau-Simard <dmsimard@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
---
@dmsimard
dmsimard / ara-benchmarks.md
Last active November 1, 2020 01:22
ara benchmarks raw data

Some roughly formatted benchmark data.

ansible without ara enabled

time ansible-playbook -i 'localhost,' -c local tests/integration/benchmark.yaml
# ...
Executed in   11.36 secs   fish           external 
   usr time   36.54 secs    0.00 micros   36.54 secs 
 sys time 16.28 secs 583.00 micros 16.28 secs 
@dmsimard
dmsimard / poc.py
Created September 10, 2020 01:43
proof of concept: expanding a pull request link into a helpful message
#!/usr/bin/env python3
# TL;DR:
# translates https://github.com/<namespace>/<repo>/pull/<id> to:
# https://api.github.com/repos/<namespace>/<repo>/pulls/<id>
# query the endpoint and return a helpful message back
from urllib.parse import urlparse
import argparse
import requests
import os
@dmsimard
dmsimard / ara_loop.yml
Created April 9, 2018 18:27
ara_loop
- name: Create many hosts
hosts: localhost
gather_facts: no
tasks:
- name: Add one host
add_host:
ansible_connection: local
hostname: "{{ item }}"
groups: many
with_sequence: start=0 end=1024 format=host%02x
@dmsimard
dmsimard / gist:2737832d077cfc5eff34
Last active February 3, 2020 15:28
Ceph Benchmarks

The tests

fio full write:

fio --name=writefile --size=100G --filesize=100G --filename=/dev/sdX --bs=1M --nrfiles=1 --direct=1 --sync=0 --randrepeat=0 --rw=write --refill_buffers --end_fsync=1 --iodepth=200 --ioengine=libaio

fio random read:

fio --time_based --name=benchmark --size=100G --runtime=30 --filename=/dev/sdX --ioengine=libaio --randrepeat=0 --iodepth=128 --direct=1 --invalidate=1 --verify=0 --verify_fatal=0 --numjobs=4 --rw=randread --blocksize=4k --group_reporting