Skip to content

Instantly share code, notes, and snippets.

View retr0h's full-sized avatar
💭
(✖╭╮✖)

נυαη נυαηѕση retr0h

💭
(✖╭╮✖)
  • Los Angeles, CA
  • 15:23 (UTC -12:00)
View GitHub Profile
#!/usr/bin/env python
import os
import ansible.constants
import ansible.inventory
import ansible.playbook
import ansible.plugins.callback
import ansible.parsing.dataloader
import ansible.utils.vars
import json
import ansible
import ansible.cli
import ansible.cli.playbook
import ansible.executor.task_queue_manager
import ansible.inventory
import ansible.parsing.dataloader
import ansible.playbook.play
import ansible.plugins.callback
def osclient(cmd,
auth_url=None,
auth_host=None,
auth_host_scheme='http',
username='admin',
user_domain_name='Default',
password='admin',
project='admin',
project_domain_name='Default',
domain_name=None,
FROM alpine:latest
ARG SOME_SECRET_SHIZ
RUN echo $SOME_SECRET_SHIZ > /tmp/secret
# Do something
RUN rm -f /tmp/secret
[jodewey:~/git/molecule_2/test/scenarios/driver/openstack] [molecule2-env-2.7.13] openstack+ ± molecule list
Instance Name Driver Name Provisioner Name Scenario Name Created Converged
--------------------- ------------- ------------------ --------------- --------- -----------
instance-1-default Openstack Ansible default False False
instance-1-multi-node Openstack Ansible multi-node False False
instance-2-multi-node Openstack Ansible multi-node False False
# In default.rb from cookbook being tested
# node.run_state['reboot'] = true
it "flags system to reboot" do
chef_run.node.run_state['reboot'].should_be true
end
@retr0h
retr0h / foo.py
Last active April 29, 2017 20:40
Logger Module
import logging
import os
import sys
import colorama
import sh
colorama.init(autoreset=True)
SUCCESS = 100
# Copyright (c) 2015-2016 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
[vagrant@k8s-01 ~]$ kubectl get pods --namespace kolla
NAME READY STATUS RESTARTS AGE
cinder-api-1293873119-sscmr 2/2 Running 0 32m
cinder-scheduler-0 1/1 Running 0 32m
cinder-volume-5fznz 1/1 Running 0 32m
glance-api-2844635357-ndq43 1/1 Running 0 32m
glance-registry-1115551799-2gjx1 2/2 Running 0 32m
horizon-4073033154-0gf7h 1/1 Running 0 32m
iscsid-1qbcb 1/1 Running 0 28m
keystone-4221194371-5tfvd 1/1 Running 0 40m
[jodewey:~/git/ansible-etcd] master(+20/-20)+ ± molecule login --host etcd-01
[root@63be8a0b63c9 /]# etcdctl --endpoints 172.17.0.3:2379,172.17.0.2:2379,172.1
9198227ac1a2c055: name=etcd-02 peerURLs=http://172.17.0.3:2380 clientURLs=http://172.17.0.3:2379 isLeader=true
983274ac8c0149ec: name=etcd-01 peerURLs=http://172.17.0.2:2380 clientURLs=http://172.17.0.2:2379 isLeader=false
ab3fbede047aa1ac: name=etcd-03 peerURLs=http://172.17.0.4:2380 clientURLs=http://172.17.0.4:2379 isLeader=false

[root@63be8a0b63c9 /]# etcdctl --endpoints 172.17.0.3:2379,172.17.0.2:2379,172.17.0.4:2379 set /foo bar
bar
[root@63be8a0b63c9 /]# etcdctl --endpoints 172.17.0.3:2379,172.17.0.2:2379,172.17.0.4:2379 get /foo