Skip to content

Instantly share code, notes, and snippets.

View samvarankashyap's full-sized avatar
🎯
Focusing

Samvaran Rallabandi samvarankashyap

🎯
Focusing
  • Red Hat
  • Toronto
View GitHub Profile
@samvarankashyap
samvarankashyap / cloudComputing_.idea_.name
Created June 10, 2015 03:23
google cloud storage utility
cloudComputing
@samvarankashyap
samvarankashyap / trystack.markdown
Created November 10, 2015 23:19 — forked from pcdinh/trystack.markdown
TryStack in 8 Simple Steps

TryStack in 8 Simple Steps

  1. Head over to trystack.org then join the facebook group to get your invite.
  2. When you get the (Somebody) approved your request to join the group TryStack notification, go login to trystack (click login using facebook and approve with facebook).
  3. Click the Security Groups tab, click Edit Rules, and add a couple rules:
    1. imcp, from port: -1, to port: -1, cidr: 0.0.0.0/0
    2. tcp, from port: 22, to port: 22, cidr: your.ip.address.here/32
  4. Click the Keypairs tab, then click Add New Keypair, name it trystack. A file will download to your computer.
  5. Click the Images tab, then click Launch next to one of the images. Fill out the form and make sure to select trystack as your Key Name and include default in the Security Groups. Click launch instance. Note the IP address you are assigned.
Using /etc/ansible/ansible.cfg as config file
[WARNING]: provided hosts list is empty, only localhost is available
Loaded callback default of type stdout, v2.0
PLAYBOOK: pluck_os.yml *********************************************************
1 plays in pluck_os.yml
PLAY [test the os_server module on async] **************************************
#!/usr/bin/env python
"""
Performs NMAP Scan(s) and tests SSH Connections (If desired)
"""
import argparse
import json
import socket
import nmap
import paramiko
[root@a778111483a5 atomic-host-tests]# ansible-playbook -vvvv -i /tmp/general_1node.inv tests/openshift-ansible-test/main
.yml
No config file found; using defaults
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc
PLAYBOOK: main.yml *************************************************************
1 plays in tests/openshift-ansible-test/main.yml
PLAY [OpenShift Ansible Installer Test] ****************************************
@samvarankashyap
samvarankashyap / pre_post_wrappers.py
Created August 10, 2017 01:48
Wrapper functions implementation in python
def wrap(pre, post):
def decorate(func):
def call(*args, **kwargs):
pre(func, *args, **kwargs)
result = func(*args, **kwargs)
post(func, *args, **kwargs)
return result
return call
return decorate
node {
echo 'Hello World'
timestamps {
// Just some echoes to show the timestamps.
stage "First echo"
echo "Hey, look, I'm echoing with a timestamp!"
// A sleep to make sure we actually get a real difference!
stage "Sleeping"
sleep 30

Automated Testing of LinchPin

LinchPin has automated testing from PR's (Pull Requests) in GitHub. Whenever a PR is updated or the trigger phrase '[test]' is included in the comment a set of tests will be kicked off. These tests are orchestrated via jenkins in the Centos CI openshift environment.

The point of these tests is to verify that LinchPin works correctly in a variety of different environments. We currently exercise current releases of both Centos and Fedora. On those distros we test the following targets: dummy, duffy, aws and libvirt. We are continuing to expand this.

These distros are provided as containers which are deployed inside the openshift environment.

apiVersion: v1
kind: BuildConfig
metadata:
name: mycustompipeline
namespace: minishift-demo
labels:
name: mycustompipeline
spec:
triggers:
- type: ConfigChange
@samvarankashyap
samvarankashyap / privileged_containers
Created August 14, 2018 14:11
enable privileged containers on openshift
> You need to have cluster adimin privilages
### edit scc
```sh
oc edit scc restricted
or
oc edit scc restricted --config=/openshift.local.config/master/admin.kubeconfig
```
> Change runAsUser type to RunAsAny