Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 512232 - app-emulation/cloud-init-0.7.5 - cloud-config fails to do initial set up?
Summary: app-emulation/cloud-init-0.7.5 - cloud-config fails to do initial set up?
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-03 02:22 UTC by kupo
Modified: 2015-12-18 02:13 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Cloud-init Configuration File (cloud_gentoo.cfg,2.38 KB, text/plain)
2014-06-03 02:22 UTC, kupo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kupo 2014-06-03 02:22:22 UTC
Created attachment 378124 [details]
Cloud-init Configuration File

I am currently having an issue with user-data scripts being ran in app-emulation/cloud-init. Normally this works fine on Fedora/Ubuntu/Debian's cloud-init package however it seems to skip over em on the Gentoo package. Here are the variations I've tried to no avail:

Option 1.

#cloud-config
chpasswd:
 list: |
   admin:password1
   root:password2
 expire: False
ssh_pwauth: True
manage_etc_hosts: True

Option 2.

#!/bin/bash
ROOTPASS='password2'
ADMINPASS='password1'
echo -e "$ROOTPASS\n$ROOTPASS" | passwd root
echo -e "$ADMINPASS\n$ADMINPASS" | passwd admin

Option 3.

#cloud-config
password: password1
chpasswd: { expire: False }
ssh_pwauth: True

Attached is my current cloud.cfg
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-06-03 17:28:01 UTC
1) Please post your `emerge --info app-emulation/cloud-init' output in a comment.
2) Please explain in a couple of steps what you are trying to accomplish (and how it fails).
Comment 2 kupo 2014-06-14 00:37:48 UTC
(In reply to Jeroen Roovers from comment #1)
> 1) Please post your `emerge --info app-emulation/cloud-init' output in a
> comment.

gentoo-test ~ # emerge --info app-emulation/cloud-init
Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.17, 3.12.20-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.12.20-gentoo-x86_64-Intel_Xeon_E312xx_-Sandy_Bridge-with-gentoo-2.2
KiB Mem:     2057140 total,   1926380 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Thu, 29 May 2014 00:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r3, 3.3.3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/"
LANG="en_US"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
USE="acl amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 mmx modules multilib ncurses nls nptl openmp pam pcre readline session sse sse2 ssl tcpd unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

app-emulation/cloud-init-0.7.5-r1 was built with the following:
USE="-test" PYTHON_TARGETS="python2_7"

> 2) Please explain in a couple of steps what you are trying to accomplish
> (and how it fails).

When an instance is created in OpenStack userdata is supposed to run as defined here;
https://help.ubuntu.com/community/CloudInit
and
http://cloudinit.readthedocs.org/en/latest/topics/format.html#user-data-script
and
http://docs.openstack.org/user-guide/content/user-data.html

However it appears to not execute bash scripts or any #cloud-config directives. A curl of the EC2 metadata server reveals that the instance can indeed reach the config;

gentoo-test ~ # curl http://169.254.169.254/2009-04-04/user-data
#cloud-config
chpasswd:
 list: |
   admin:password1
   root:password2
 expire: False
ssh_pwauth: True
manage_etc_hosts: Truegentoo-test ~ #
Comment 3 kupo 2014-06-14 00:44:44 UTC
In addition it may be parsing #cloud-init however the 'chpasswd' functionality appears to be broken as it indeed changed my /etc/hosts to managed.

gentoo-test ~ # cat /etc/hosts
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data
127.0.1.1 gentoo-test.novalocal gentoo-test
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


However testing with a simple bash script was confirmed to not work
gentoo-test-2 ~ # cd /var
gentoo-test-2 var # ls
cache  db  empty  lib  lock  log  nullmailer  run  spool  tmp
gentoo-test-2 var # curl http://169.254.169.254/2009-04-04/user-data
#!/bin/bash
echo 'cookies' > /var/cookies
gentoo-test-2 var # cat /var/cookies
cat: /var/cookies: No such file or directory
gentoo-test-2 var #
Comment 4 Alex Brandt (RETIRED) gentoo-dev 2014-10-25 20:28:19 UTC
Sorry this is a delayed response.  Is the chpasswd functionality the only broken functionality you know of and have you tried the latest version of cloud-init?  I'd like to determine if this is something that got missed during packaging or something that might be missing from cloud-init.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-11-03 20:58:11 UTC
(In reply to Alex Brandt from comment #4)
> Sorry this is a delayed response.  Is the chpasswd functionality the only
> broken functionality you know of and have you tried the latest version of
> cloud-init?  I'd like to determine if this is something that got missed
> during packaging or something that might be missing from cloud-init.
@alunduil:
Per your request, I tested 0.7.6 on a RAX box, and there's definitely something not right. It didn't even change the /etc/hosts in my testcase.
Comment 6 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-12-18 02:13:25 UTC
The 0.7.6-r1 should be good (it's good for vanilla openstack).

rackspace isn't using cloud-init yet :(