start new:
tmux
start new with session name:
tmux new -s myname
| dnf install -y ansible qemu-img qemu-kvm wget unzip | |
| cd /tmp | |
| wget https://releases.hashicorp.com/packer/1.1.1/packer_1.1.1_linux_amd64.zip | |
| unzip packer*.zip | |
| # Use packerio as a binary name, because packer binary already exists in fedora : /usr/sbin/packer as part of cracklib-dicts package | |
| mv packer /usr/local/bin/packerio | |
| # Install WinRM communicator for Packer (https://www.packer.io/docs/provisioners/ansible.html#winrm-communicator) |
| #!/usr/bin/python | |
| import sys | |
| import re | |
| import subprocess | |
| if len(sys.argv) != 2: | |
| print "bridge name needed" | |
| sys.exit() |
| # | |
| # Ansible playbook to prepare the undercloud machine. | |
| # Will preform all steps until custom steps are to be taken -- | |
| # which are: providing a custom undercloud.conf and running | |
| # openstack install undercloud command and so on... | |
| # Root SSH access to the remote machine has to be configured. | |
| # Edit vars as necessary. | |
| # | |
| # If this is the first time you are using Ansible on a host, |
| #! /usr/bin/python | |
| import sys | |
| import ldap | |
| from ldap.controls import SimplePagedResultsControl | |
| from distutils.version import LooseVersion | |
| # Check if we're using the Python "ldap" 2.4 or greater API | |
| LDAP24API = LooseVersion(ldap.__version__) >= LooseVersion('2.4') |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| #!/usr/bin/env python | |
| import shlex, subprocess, argparse | |
| from os import listdir | |
| # command line arguments | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('-n','--hostname', type=str, required=True) | |
| parser.add_argument('-i','--ipaddr', type=str, required=True) | |
| parser.add_argument('-m','--netmask', type=str, required=True) |
| # | |
| # Copyright (C) 2013-2020 Vinay Sajip. New BSD License. | |
| # | |
| import os | |
| import os.path | |
| from subprocess import Popen, PIPE | |
| import sys | |
| from threading import Thread | |
| from urllib.parse import urlparse | |
| from urllib.request import urlretrieve |
| import click | |
| from kubernetes import client, config, stream | |
| import os | |
| import sys | |
| @click.command() | |
| @click.argument('pod_name') | |
| @click.option('--namespace', '-n', default='default', help='Namespace of the pod') | |
| @click.option('--env_var', '-e', multiple=True, help='Environment variable in the format VAR=VALUE') | |
| @click.option('--command', '-c', required=True, help='Command to run in the pod') |
| import click | |
| import csv | |
| import logging | |
| import asyncio | |
| from kubernetes_asyncio import client, config | |
| from collections import defaultdict | |
| from filelock import FileLock | |
| from concurrent.futures import ThreadPoolExecutor, as_completed | |
| # Configure logging |