Skip to content

Instantly share code, notes, and snippets.

View Akasurde's full-sized avatar
🌏
To the infinity and beyond

Abhijeet Kasurde Akasurde

🌏
To the infinity and beyond
View GitHub Profile
plugin: community.general.virtualbox
groups:
container: "'mini' in (inventory_hostname)"
plugin: community.general.virtualbox
compose:
guest_os: vbox_Guest_OS
@Akasurde
Akasurde / cache_virtualbox.yml
Created February 23, 2021 13:48
Caching using virtualbox inventory
plugin: community.general.virtualbox
running_only: True
cache: yes
cache_plugin: ansible.builtin.jsonfile
cache_timeout: 7200
cache_connection: /tmp/virtualbox
cache_prefix: vbox_cache_
@Akasurde
Akasurde / clone_virtualmachine.yml
Created February 24, 2021 09:24
Creating a new virtual machine using existing virtual machine
---
- hosts: localhost
vars_files:
- vcenter_vars.yml
vars:
cluster_name: 'Asia-Cluster1'
datastore_name: 'ds_200'
folder_name: 'prod'
src_vm_name: CentOS_8
dest_vm_name: deployed_centos_8
@Akasurde
Akasurde / rename_by_name.yml
Created March 2, 2021 09:08
Rename datastore object using Name
---
- hosts: localhost
gather_facts: no
vars_files:
- vcenter_vars.yml
tasks:
- community.vmware.vmware_object_rename:
new_name: "DS_171_2"
object_name: "DS_117_1"
object_type: Datastore
@Akasurde
Akasurde / moid_datastore.yml
Created March 2, 2021 09:49
Rename datastore object using MoID
---
- hosts: localhost
gather_facts: no
vars_files:
- vcenter_vars.yml
vars:
datastore_name: "DS_117_1"
tasks:
- name: Provide information about datastore {{ datastore_name }}
community.vmware.vmware_datastore_info:
@Akasurde
Akasurde / mysql_pod.yml
Created March 9, 2021 04:40
Create MySQL database pod with preloaded data
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-deployment
labels:
app: mysql
spec:
replicas: 1
selector:
matchLabels:
import pytest
import re
from six import PY2
def check_solaris_version(filename='/etc/release'):
with open(filename) as f:
content = f.readlines()
for line in content:
m = re.match(r'\s+Oracle Solaris (\d+\.\d+).*', line.rstrip())
from subprocess import Popen
from flask import Flask, request, jsonify
admission_controller = Flask(__name__)
@admission_controller.route("/validate", methods=["POST"])
def deployment_webhook():
request_info = request.get_json()
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: "trivy-scanner.example.com"
webhooks:
- name: "trivy-scanner.example.com"
rules:
- apiGroups: [""]
apiVersions: ["v1"]
operations: ["CREATE"]