Connection are reused if the task has a loop.
lib/ansible/executor/task_executor.py -> self._connection = self._get_connection(variables=variables, templar=templar)
- hosts: localhost | |
gather_facts: false | |
tasks: | |
- k8s_info: | |
kind: Pod | |
with_sequence: count=100 |
#!/bin/bash | |
set -eux | |
aws --version |grep aws-cli || pip install awscli | |
bucket_name="nodepool-images-test" | |
if ! aws s3 ls s3://${bucket_name}; then | |
aws s3 mb s3://${bucket_name} --region us-east-2 | |
fi | |
for image_local_path in $(find /opt/nodepool/images -maxdepth 1 -name 'centos-8-0000002059.raw'); do |
#!/bin/bash | |
set -eux | |
# https://virt-lightning.org/ | |
vl fetch ubuntu-18.04 | |
vl start --memory 2048 ubuntu-18.04 | |
target=$(vl status| awk '/ubuntu-1804/ {print$4}') | |
ssh $target sudo chsh -s /bin/bash goneri | |
ssh $target sudo apt update | |
# My stuff | |
ssh $target sudo apt install -y silversearcher-ag |
# No compression/unsecure | |
xfreerdp /u:goneri /w:1880 /h:1000 /v:localhost:3389 /sound:sys:pulse -compression -encryption +home-drive | |
# Compression/Secure | |
xfreerdp /u:goneri /w:1880 /h:1000 /v:localhost:3389 /sound:sys:pulse +home-drive |
#!/bin/bash | |
set -eux | |
commits=$* | |
current_dir=$(pwd) | |
temp_dir=$(mktemp -du) | |
github_user=$(git config --get github.user) | |
origin_url=$(git config --get remote.origin.url) | |
project=$(git config --get remote.origin.url|sed 's,/$,,'|sed 's,.*/,,') |
#!/bin/bash | |
set -eux | |
function clean_up_volumes() { | |
openstack volume list -f value -c ID -c Status|awk '/available/ {print $1}'|xargs -r openstack volume delete | |
} | |
OS_CLOUD=vexxhost OS_REGION_NAME=ca-ymq-1 clean_up_volumes | |
OS_CLOUD=vexxhost OS_REGION_NAME=sjc1 clean_up_volumes | |
OS_CLOUD=limestone OS_REGION_NAME=us-slc clean_up_volumes | |
OS_CLOUD=limestone OS_REGION_NAME=us-dfw-1 clean_up_volumes |
#!/usr/bin/python | |
import re | |
import urllib.request | |
import argparse | |
import subprocess | |
parser = argparse.ArgumentParser() | |
parser.add_argument("pr_id", type=int) |
import json | |
import re | |
from pprint import pprint | |
def path_to_module_name(path, value): | |
def is_element(i): | |
if i and not '{' in i: | |
return True | |
else: |
#!/bin/bash | |
set -eux | |
git clone https://github.com/goneri/ansible_vmware_collection /tmp/cherry_pick_demo | |
cd /tmp/cherry_pick_demo | |
# starts a dev branch | |
git checkout -B dev origin/master | |
git mv community/vmware/plugins/modules/vmware_dvswitch.py ansible/vmware/plugins/modules/ |