Things I wish I'd Known Earlier

But learned the hard way!

cloud-init “gotcha”

Written by Tim on September 30, 2015

I was putting together a project using The Foreman to spin up and manage Amazon EC2 instances and ran into a problem. I could take an AMI and launch it, but I couldn’t ssh into it.

One of the major reasons why this was so was that cloud-init was silently failing and as a result, my ssh key wasn’t being installed.

The AMIs in question were built on top of Ubuntu 14.04LTS. The Foreman creates its own private access key to launch and control EC2 instances and it’s not accessible for general use. You have to supply your own private key if you want to login via ssh.

The recommended way to do that is to inject it via cloud-init. However, cloud-init wasn’t working right.

After a lot of experimentation, I discovered that the issue was in the attempt to also use cloud-init to set the simple hostname and fqdn of the newly-created host. Turns out that including the “host:” line like all the samples out on the Internet do causes the ENTIRE cloud-init file to be ignored. So in order to get my ssh key (AND hostname) injected, I just needed the “fqdn:” line.

Posted In Stupid Linux Tricks | The Cloud
Tagged Amazon EC2 | cloud-init | theforeman | Ubuntu

Post navigation

PreviousApache, Tomcat and SSL – with Pictures!
NextQuick-printing recipes with a Bluetooth POS Thermal Printer

Categories

  • Android
  • Bad Practices
  • Better Software Design
  • Enterprise Java
  • Hardware
  • Internet of Things
  • Java Persistence Architecture (JPA) and related ORM
  • Libre Office
  • MillRight CNC
  • Random maniacal ravings
  • Stupid Linux Tricks
  • The Cloud
  • Uncategorized
July 2022
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Jun    

Categories

  • Android
  • Bad Practices
  • Better Software Design
  • Enterprise Java
  • Hardware
  • Internet of Things
  • Java Persistence Architecture (JPA) and related ORM
  • Libre Office
  • MillRight CNC
  • Random maniacal ravings
  • Stupid Linux Tricks
  • The Cloud
  • Uncategorized

Tags

Android annoyances jpa hibernate Apache Arduino attach ATTiny85 centos centos 7 configuration date/time design detach DigiSpark documents Enterprise Java Facelets floating-point fonts graphviz hibernate howto IDE Imprecise data types JBoss JPA JSF linux Maven oowriter openjpa ORM recipe RichFaces scalable graphics security spring testing Tomahawk Tomcat tomcat5 tomcat6 Tomcat Instrumentation vector graphics weaver Xen

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright © 2022. Things I wish I'd Known Earlier
Powered By WordPress and Auspicious