Skip to content

Instantly share code, notes, and snippets.

@dalitun
dalitun / convert-and-test.sh
Created December 9, 2021 17:45 — forked from filipenf/convert-and-test.sh
Script to convert an ansible vault into a yaml file with encrypted strings
#!/bin/bash
#Vault password is 1
echo "Converting vault to yaml format:"
ansible-vault decrypt --output - vault | python ./convert_vault.py > new-vault.yml
echo "Decrypting a variable from the converted vault"
ansible localhost -i localhost, -e @new-vault.yml -m debug -a 'var=secret' --ask-vault-pas
@dalitun
dalitun / 1_dmz-provisioner.sh
Created March 18, 2019 14:52 — forked from kenmoini/1_dmz-provisioner.sh
Disconnected DevSecOps with Red Hat OpenShift Container Platform - DMZ Repo Mirror Provisioner
#!/bin/bash
LOCAL_REPO_PATH="/opt/repos"
# This script enables the needed RHEL, OpenShift, Gluster, Ansible, HA, and additional repos needed to mirror them locally.
# The locally created mirror can then be used to deploy OCP into a disconnected environment.
#===== PRE-RUN NOTES:
# This assumes you've already registered and subscribed to the needed OpenShift, Gluster, Ansible, and RHEL subscriptions.
@dalitun
dalitun / k8s-user-data.sh
Created October 8, 2018 19:40 — forked from initcron/k8s-user-data.sh
kubernetes user data script
#!/bin/bash
apt-get update
apt-get install -y git wget
# Install Docker
apt-get install \
apt-transport-https \
ca-certificates \
curl \
@dalitun
dalitun / k8s-user-data.sh
Created October 8, 2018 19:40 — forked from initcron/k8s-user-data.sh
kubernetes user data script
#!/bin/bash
apt-get update
apt-get install -y git wget
# Install Docker
apt-get install \
apt-transport-https \
ca-certificates \
curl \
@dalitun
dalitun / Install Vagrant Libvirt Fedora 27.md
Created September 29, 2018 12:03 — forked from gangsta/Install Vagrant Libvirt Fedora 27.md
How to install Libvirt Vagrant on Fedora 27

How to Install Vagrant and Livbirt Fedora 27

Check for cpu Virtualization

lsmod | grep kvm
kvm_intel             167936  3
kvm                   499712  1 kvm_intel

Install

@dalitun
dalitun / README.md
Created September 29, 2018 11:57 — forked from kmassada/README.md
Vagrant and KVM(QEMU) on Centos7

Libvirt

yum group install -y "Development Tools"
yum -y install qemu-kvm libvirt virt-install bridge-utils libvirt-devel  libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
echo "net.ipv4.ip_forward = 1"|sudo tee /etc/sysctl.d/99-ipforward.conf
sysctl -p /etc/sysctl.d/99-ipforward.conf
@dalitun
dalitun / gist:36d90b47bde4d88c097907f8d3e8c772
Created September 28, 2018 21:52 — forked from jcantrill/gist:eca85af2057b84642510cc086f1e5b97
Standing up Openshift using 'oc cluster up' and ansible
Overview
At the time of writing this document, 'oc cluster up --logging' or its 3.11 equivalent is broken. Following are instructions on using 'oc cluster up' followed by ansible to install logging. These instructions are generally valid for any Openshift release from 3.5 to 3.11.
Environment
These instructions are based on using:
Host: Centos 7 on libvirt
Mem: 8G
@dalitun
dalitun / receive.py
Created August 28, 2018 07:49 — forked from tomas-stefano/receive.py
RabbitMQ example in Python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
def callback(ch, method, properties, body):
print "[x] Received: %r" % (body,)
channel.basic_consume(callback, queue='hello', no_ack=True)
@dalitun
dalitun / awxinstalleronopenshift.sh
Created August 16, 2018 09:12 — forked from erbrito/awxinstalleronopenshift.sh
Deploy of AWX (Ansible Tower) on OpenShift
mkdir Tower
cd Tower/
git clone https://github.com/ansible/awx.git
cd awx
cd installer/
#vi inventory
-# openshift_host=127.0.0.1:8443
-# awx_openshift_project=awx
-# openshift_user=developer
---
- hosts: localhost
connection: local
tasks:
- debug: var=ansible_all_ipv4_addresses
- debug: var=ansible_default_ipv4.address
- debug: var=ansible_dns.nameservers[0]
#ansible -m setup localhost -c local