Skip to content

Instantly share code, notes, and snippets.

View trinitronx's full-sized avatar
⛩️
Zazen

James Cuzella trinitronx

⛩️
Zazen
View GitHub Profile
@trinitronx
trinitronx / keybase.md
Created March 28, 2016 22:43
Keybase identity proof

Keybase proof

I hereby claim:

  • I am trinitronx on github.
  • I am trinitronx (https://keybase.io/trinitronx) on keybase.
  • I have a public key whose fingerprint is 177C AEC0 0C77 B281 2AD2 886F 1ABA 4874 3609 41DA

To claim this, I am signing this object:

Running the a playbook to create an EC2 host, I find that there is a race condition for Ansible to be able to connect to the host.

Both wait_for and shell: echo host_is_up (with retry / do..until loop) tasks are not enough to avoid hitting the race condition where Ansible fails to SSH.

Running the play shows that the "Wait for SSH" task completes successfully, and the initial connect for the "Wait up to 10mins for potential cloud-init sshd race condition" task fails completely without retrying as I had expected:

$ export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPQRST
$ export AWS_ACCESS_KEY=$AWS_ACCESS_KEY_ID
$ export AWS_SECRET_ACCESS_KEY=1234567890abcdefghijklmnopqrstuvwxyzABCD

$ export AWS_SECRET_KEY=$AWS_SECRET_ACCESS_KEY

@trinitronx
trinitronx / iterm_open_with
Last active June 26, 2021 01:19 — forked from sos4nt/iterm_open_with
Semantic history command for iTerm2 and Sublime Text 3. Allows iTerm integration of Command+Click to open a file in default app (if non-text), or Sublime Text with optional line number and column. Detects relative paths based on PWD.
#!/bin/sh
# iterm_open_with - open a URL, file from CWD, full path, or path with linenumber in default app or Sublime Text if text file
# For usage with iTerm2:
# In iTerm's Preferences > Profiles > Default > Advanced > Semantic History,
# choose "Run command..." and enter "/your/path/to/iterm_open_with \5 \1 \2".
# Usage: iterm_open_with $(pwd) filename [linenumber]
# $(pwd) = current working directory (either use `pwd` or $PWD)
# filename = filename to open
# lineno = line number
pwd=$1
PLAY [test-kitchen] ***********************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [altermn.rvm | include install type vars] *******************************
ok: [localhost] => {"ansible_facts": {"rvm_init_script": "/etc/profile.d/rvm.sh", "rvm_root": "/usr/local/rvm"}}
TASK: [altermn.rvm | ensure necessary yum packages are installed] *************
skipping: [localhost]
@trinitronx
trinitronx / README.md
Last active March 3, 2022 07:29
A shell script to install latest Ansible via pip + dependencies

omnibus-ansible

This script has moved to: neillturner/omnibus-ansible

This is the original version of the Ansible install script. If you want the latest, please see the above link!

Install latest Ansible via pip + dependencies via a shell script

This file is used to install ansible in test kitchen when you set in the kitchen.yaml file

@trinitronx
trinitronx / chef-rvm-283.log
Created May 7, 2015 01:14
chef-rvm cookbook global_gem rvm_environment NoMethodError
* rvm_global_gem[bundler] action install
* execute[Add bundler to /home/trinitronx/.rvm/gemsets/global.gems] action run
- execute echo "bundler" >> "/home/trinitronx/.rvm/gemsets/global.gems"
* rvm_gem[bundler] action install (up to date)
[2015-05-05T18:57:07-06:00] WARN: Cloning resource attributes for rvm_gem[bundler] from prior resource (CHEF-3694)
[2015-05-05T18:57:07-06:00] WARN: Previous rvm_gem[bundler]: /var/chef/cache/cookbooks/rvm/providers/global_gem.rb:48:in `gem_package_wrapper'
[2015-05-05T18:57:07-06:00] WARN: Current rvm_gem[bundler]: /var/chef/cache/cookbooks/rvm/providers/global_gem.rb:48:in `gem_package_wrapper'
* rvm_gem[bundler] action install (up to date)
[2015-05-05T18:57:09-06:00] WARN: Cloning resource attributes for rvm_gem[bundler] from prior resource (CHEF-3694)
[2015-05-05T18:57:09-06:00] WARN: Previous rvm_gem[bundler]: /var/chef/cache/cookbooks/rvm/providers/global_gem.rb:48:in `gem_package_wrapper'

docker pull Output:

Running on docker daemon/client host with IP 12.34.56.78

2015/04/15 17:01:01 Get https://registry.example.com:443/v1/repositories/library/ansible-base/images: read tcp 33.33.33.33:443: i/o timeout

docker daemon Logs (/var/log/docker):

Docker Registry Log:

172.17.0.19 - - [10/Apr/2015:16:39:38 +0000] "GET /v1/search HTTP/1.1" 200 1435 "-" "-"
172.17.0.19 - - [10/Apr/2015:16:39:38 +0000] "GET /v1/repositories/brosephus/app_prototype/tags HTTP/1.1" 200 78 "-" "-"
172.17.0.19 - - [10/Apr/2015:16:40:39 +0000] "GET /v1/repositories/brosephus/sweet_web_app/tags HTTP/1.1" 200 157 "-" "-"
172.17.0.19 - - [10/Apr/2015:16:40:41 +0000] "GET /v1/repositories/example/web_container/tags HTTP/1.1" 200 27959 "-" "-"
[2015-04-10 16:41:42 +0000] [127] [ERROR] Error handling request
Traceback (most recent call last):
@trinitronx
trinitronx / kitchen-default-centos-64.log
Created November 19, 2014 05:33
yum-epel failure on CentOS 6.4 (due to httpS / SSL verify failure / old CA cert bundle)
---- Begin output of yum -q makecache --disablerepo=* --enablerepo=epel ----
STDOUT:
STDERR: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
---- End output of yum -q makecache --disablerepo=* --enablerepo=epel ----
Ran yum -q makecache --disablerepo=* --enablerepo=epel returned 1
Resource Declaration:
---------------------
# In /tmp/kitchen/cookbooks/yum-epel/recipes/default.rb
@trinitronx
trinitronx / apt-term.log
Created September 30, 2014 02:36
apt-term.log: Failed do-release-upgrade due to mono (BLEGH!!) See here for solution: http://askubuntu.com/a/530212/19264
Installing new version of config file /etc/console-setup/compose.ISO-8859-7.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-2.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-9.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-14.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-15.inc ...
Your console font configuration will be updated the next time your system
boots. If you want to update it now, run 'setupcon' from a virtual console.
update-initramfs: deferring update (trigger activated)
Setting up bluez-cups (4.101-0ubuntu13) ...
Setting up colord (1.0.6-1) ...