Skip to content

Instantly share code, notes, and snippets.

@hoonetorg
hoonetorg / check_salt_state.py
Created February 18, 2016 19:16 — forked from djs52/check_salt_state.py
Nagios Salt check which tests the highstate
#!/usr/bin/env python
import salt.client
import argparse
import sys
import fnmatch
import unittest
# Filter out results from state modules that don't have useful test
# such as svn.latest and pkg.refresh_db.
# Represent as a list of 4-tuples of globs: (module, state_id, state_name, function)
#On the node where the tenant vars are sourced
[root@os1 ~]# cat /etc/neutron/plugins/ml2/linuxbridge_agent.ini |grep mapping
# mapping physical network names to the agent's node-specific physical network
# listed in network_vlan_ranges on the server should have mappings to
physical_interface_mappings = provider:bond0.2
[root@os1 ~]# neutron agent-list
+--------------------------------------+--------------------+--------------------+-------------------+-------+----------------+---------------------------+
######### !!!!!!!!!! with bridge_mappings
[root@os1 ~]# cat /etc/neutron/plugins/ml2/linuxbridge_agent.ini |grep mapping
# mapping physical network names to the agent's node-specific physical network
# listed in network_vlan_ranges on the server should have mappings to
#physical_interface_mappings = provider:bond0.2
#bridge_mappings =
bridge_mappings = provider:brextern
[root@os1 ~]# neutron agent-list
+--------------------------------------+--------------------+--------------------+-------------------+-------+----------------+---------------------------+
@hoonetorg
hoonetorg / nested-virt.yaml
Created June 5, 2017 13:34 — forked from xsgordon/nested-virt.yaml
Playbook to enable nested virtualization for Intel CPUs on RHEL 7
# E.g. ansible-playbook nested-virt.yaml --extra-vars target=127.0.0.1
---
- hosts: "{{target}}"
tasks:
- name: Disable reverse path filtering (default)
sysctl: >
name=net.ipv4.conf.default.rp_filter
value=0
state=present
- name: Disable reverse path filtering (all)
@hoonetorg
hoonetorg / gist:c5f9580390adcf4fe5704818f5cedbbd
Created December 15, 2017 18:25
ansible shell command only if another shell command does the correct thing when looping over a list
vars:
drbdmanage_m:
volumes:
- name: server1_disk1
size: 30G
- name: server1_disk2
size: 30G
task:
--- drbd-kernel.spec.orig 2017-06-01 11:13:44.000000000 +0200
+++ drbd-kernel.spec 2018-04-16 16:34:58.452833855 +0200
@@ -4,6 +4,9 @@ Version: 8.4.10
Release: 1%{?dist}
%global tarball_version %(echo "%{version}-%{?release}" | sed -e "s,%{?dist}$,,")
Source: http://oss.linbit.com/drbd/drbd-%{tarball_version}.tar.gz
+
+Patch1: add-RHEL74-compat-hack.patch
+
License: GPLv2+
#!/bin/bash
VM=$1
DESTHOST=$2
[ -z "$VM" ] && exit 1
[ -z "$DESTHOST" ] && exit 1
(virsh list --name |grep -w "$VM") || exit 1
echo "$VM is running here"
yum reinstall zeromq
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package zeromq.x86_64 0:4.1.4-6.el7 will be reinstalled
--> Processing Dependency: libsodium.so.23()(64bit) for package: zeromq-4.1.4-6.el7.x86_64
--> Running transaction check
---> Package libsodium.x86_64 0:1.0.5-1.el7 will be updated
--> Processing Dependency: libsodium.so.13()(64bit) for package: zeromq-4.1.4-6.el7.x86_64
TEST MODE:
----------
ID: selinux-config
Function: file.managed
Name: /etc/selinux/config
Result: None
Comment: The file /etc/selinux/config is set to be changed
Started: 21:54:22.051914
Duration: 24.64 ms
Changes: