fgrehm / vagrant-lxc

LXC provider for Vagrant
MIT License
1.2k stars 181 forks source link

Build scripts do not run PUPPET, CHEF, etc. options #183

Closed abevoelker closed 11 years ago

abevoelker commented 11 years ago

When trying to run the build-ubuntu-box.sh script with e.g. PUPPET=1, I do not see the installing puppet expected output but instead see

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

After running the generated box I confirmed that Puppet does not get installed. This issue prevented me from properly testing the Ansible script I wrote in PR #182.

Feel free to close this issue if it's not worth your time to investigate. Just thought I'd let you know of what I experienced. Thanks again for the awesome project!

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.3 LTS
Release:        12.04
Codename:       precise
$ uname -a
Linux abe-PC 3.8.0-32-generic #47~precise1-Ubuntu SMP Wed Oct 2 16:19:35 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ vagrant --version
Vagrant 1.3.5
$ vagrant plugin list
vagrant-lxc (0.7.0)
$ pwd
/tmp/vagrant-lxc/boxes
$ PUPPET=1 sudo ./build-ubuntu-box.sh precise amd64

No config file specified, using the default config
debootstrap is /usr/sbin/debootstrap
Checking cache download in /var/cache/lxc/precise/rootfs-amd64 ... 
Copy /var/cache/lxc/precise/rootfs-amd64 to /var/lib/lxc/precise-base/rootfs ... 
Copying rootfs to /var/lib/lxc/precise-base/rootfs ...

##
# The default user is 'ubuntu' with password 'ubuntu'!
# Use the 'sudo' command to run tasks as root in the container.
##

'ubuntu' template installed
'precise-base' created
Reading package lists...
Building dependency tree...
Reading state information...
vim is already the newest version.
The following extra packages will be installed:
  bsdmainutils ca-certificates groff-base libasn1-8-heimdal libcurl3
  libgcrypt11 libgdbm3 libgnutls26 libgpg-error0 libgssapi3-heimdal
  libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal
  libhx509-5-heimdal libidn11 libkrb5-26-heimdal libldap-2.4-2 libp11-kit0
  libpipeline1 libroken18-heimdal librtmp0 libsasl2-2 libsasl2-modules
  libtasn1-3 libwind0-heimdal openssl
Suggested packages:
  cpp wamerican wordlist whois vacation groff rng-tools gnutls-bin
  libsasl2-modules-otp libsasl2-modules-ldap libsasl2-modules-sql
  libsasl2-modules-gssapi-mit libsasl2-modules-gssapi-heimdal www-browser
The following NEW packages will be installed:
  bash-completion bsdmainutils ca-certificates curl groff-base
  libasn1-8-heimdal libcurl3 libgcrypt11 libgdbm3 libgnutls26 libgpg-error0
  libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal
  libheimntlm0-heimdal libhx509-5-heimdal libidn11 libkrb5-26-heimdal
  libldap-2.4-2 libp11-kit0 libpipeline1 libroken18-heimdal librtmp0
  libsasl2-2 libsasl2-modules libtasn1-3 libwind0-heimdal man-db openssl wget
0 upgraded, 30 newly installed, 0 to remove and 0 not upgraded.
Need to get 5822 kB of archives.
After this operation, 15.5 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ precise-updates/main bash-completion all 1:1.3-1ubuntu8.1 [134 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ precise-updates/main libroken18-heimdal amd64 1.6~git20120311.dfsg.1-2ubuntu0.1 [46.0 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ precise-updates/main libasn1-8-heimdal amd64 1.6~git20120311.dfsg.1-2ubuntu0.1 [220 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ precise/main libgpg-error0 amd64 1.10-2ubuntu1 [14.5 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ precise-updates/main libgcrypt11 amd64 1.5.0-3ubuntu0.2 [280 kB]
Get:6 http://archive.ubuntu.com/ubuntu/ precise/main libgdbm3 amd64 1.8.3-10 [35.3 kB]
Get:7 http://archive.ubuntu.com/ubuntu/ precise/main libp11-kit0 amd64 0.12-2ubuntu1 [34.3 kB]
Get:8 http://archive.ubuntu.com/ubuntu/ precise-updates/main libtasn1-3 amd64 2.10-1ubuntu1.1 [43.3 kB]
Get:9 http://archive.ubuntu.com/ubuntu/ precise-updates/main libgnutls26 amd64 2.12.14-5ubuntu3.5 [459 kB]
Get:10 http://archive.ubuntu.com/ubuntu/ precise-updates/main libhcrypto4-heimdal amd64 1.6~git20120311.dfsg.1-2ubuntu0.1 [103 kB]
Get:11 http://archive.ubuntu.com/ubuntu/ precise-updates/main libheimbase1-heimdal amd64 1.6~git20120311.dfsg.1-2ubuntu0.1 [33.1 kB]
Get:12 http://archive.ubuntu.com/ubuntu/ precise-updates/main libwind0-heimdal amd64 1.6~git20120311.dfsg.1-2ubuntu0.1 [77.8 kB]
Get:13 http://archive.ubuntu.com/ubuntu/ precise-updates/main libhx509-5-heimdal amd64 1.6~git20120311.dfsg.1-2ubuntu0.1 [125 kB]
Get:14 http://archive.ubuntu.com/ubuntu/ precise-updates/main libkrb5-26-heimdal amd64 1.6~git20120311.dfsg.1-2ubuntu0.1 [234 kB]
Get:15 http://archive.ubuntu.com/ubuntu/ precise-updates/main libheimntlm0-heimdal amd64 1.6~git20120311.dfsg.1-2ubuntu0.1 [16.0 kB]
Get:16 http://archive.ubuntu.com/ubuntu/ precise-updates/main libgssapi3-heimdal amd64 1.6~git20120311.dfsg.1-2ubuntu0.1 [108 kB]
Get:17 http://archive.ubuntu.com/ubuntu/ precise/main libidn11 amd64 1.23-2 [112 kB]
Get:18 http://archive.ubuntu.com/ubuntu/ precise-updates/main libsasl2-2 amd64 2.1.25.dfsg1-3ubuntu0.1 [69.1 kB]
Get:19 http://archive.ubuntu.com/ubuntu/ precise-updates/main libldap-2.4-2 amd64 2.4.28-1.1ubuntu4.4 [185 kB]
Get:20 http://archive.ubuntu.com/ubuntu/ precise/main libpipeline1 amd64 1.2.1-1 [26.5 kB]
Get:21 http://archive.ubuntu.com/ubuntu/ precise/main librtmp0 amd64 2.4~20110711.gitc28f1bab-1 [57.1 kB]
Get:22 http://archive.ubuntu.com/ubuntu/ precise-updates/main openssl amd64 1.0.1-4ubuntu5.10 [524 kB]
Get:23 http://archive.ubuntu.com/ubuntu/ precise/main ca-certificates all 20111211 [169 kB]
Get:24 http://archive.ubuntu.com/ubuntu/ precise-updates/main libcurl3 amd64 7.22.0-3ubuntu4.3 [237 kB]
Get:25 http://archive.ubuntu.com/ubuntu/ precise/main bsdmainutils amd64 8.2.3ubuntu1 [200 kB]
Get:26 http://archive.ubuntu.com/ubuntu/ precise/main groff-base amd64 1.21-7 [1046 kB]
Get:27 http://archive.ubuntu.com/ubuntu/ precise-updates/main libsasl2-modules amd64 2.1.25.dfsg1-3ubuntu0.1 [63.2 kB]
Get:28 http://archive.ubuntu.com/ubuntu/ precise-updates/main man-db amd64 2.6.1-2ubuntu1 [755 kB]
Get:29 http://archive.ubuntu.com/ubuntu/ precise/main wget amd64 1.13.4-2ubuntu1 [277 kB]
Get:30 http://archive.ubuntu.com/ubuntu/ precise-updates/main curl amd64 7.22.0-3ubuntu4.3 [138 kB]
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "en_US.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
Fetched 5822 kB in 1s (4613 kB/s)
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously unselected package bash-completion.
(Reading database ... 11577 files and directories currently installed.)
Unpacking bash-completion (from .../bash-completion_1%3a1.3-1ubuntu8.1_all.deb) ...
Selecting previously unselected package libroken18-heimdal.
Unpacking libroken18-heimdal (from .../libroken18-heimdal_1.6~git20120311.dfsg.1-2ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libasn1-8-heimdal.
Unpacking libasn1-8-heimdal (from .../libasn1-8-heimdal_1.6~git20120311.dfsg.1-2ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libgpg-error0.
Unpacking libgpg-error0 (from .../libgpg-error0_1.10-2ubuntu1_amd64.deb) ...
Selecting previously unselected package libgcrypt11.
Unpacking libgcrypt11 (from .../libgcrypt11_1.5.0-3ubuntu0.2_amd64.deb) ...
Selecting previously unselected package libgdbm3.
Unpacking libgdbm3 (from .../libgdbm3_1.8.3-10_amd64.deb) ...
Selecting previously unselected package libp11-kit0.
Unpacking libp11-kit0 (from .../libp11-kit0_0.12-2ubuntu1_amd64.deb) ...
Selecting previously unselected package libtasn1-3.
Unpacking libtasn1-3 (from .../libtasn1-3_2.10-1ubuntu1.1_amd64.deb) ...
Selecting previously unselected package libgnutls26.
Unpacking libgnutls26 (from .../libgnutls26_2.12.14-5ubuntu3.5_amd64.deb) ...
Selecting previously unselected package libhcrypto4-heimdal.
Unpacking libhcrypto4-heimdal (from .../libhcrypto4-heimdal_1.6~git20120311.dfsg.1-2ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libheimbase1-heimdal.
Unpacking libheimbase1-heimdal (from .../libheimbase1-heimdal_1.6~git20120311.dfsg.1-2ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libwind0-heimdal.
Unpacking libwind0-heimdal (from .../libwind0-heimdal_1.6~git20120311.dfsg.1-2ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libhx509-5-heimdal.
Unpacking libhx509-5-heimdal (from .../libhx509-5-heimdal_1.6~git20120311.dfsg.1-2ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libkrb5-26-heimdal.
Unpacking libkrb5-26-heimdal (from .../libkrb5-26-heimdal_1.6~git20120311.dfsg.1-2ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libheimntlm0-heimdal.
Unpacking libheimntlm0-heimdal (from .../libheimntlm0-heimdal_1.6~git20120311.dfsg.1-2ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libgssapi3-heimdal.
Unpacking libgssapi3-heimdal (from .../libgssapi3-heimdal_1.6~git20120311.dfsg.1-2ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libidn11.
Unpacking libidn11 (from .../libidn11_1.23-2_amd64.deb) ...
Selecting previously unselected package libsasl2-2.
Unpacking libsasl2-2 (from .../libsasl2-2_2.1.25.dfsg1-3ubuntu0.1_amd64.deb) ...
Selecting previously unselected package libldap-2.4-2.
Unpacking libldap-2.4-2 (from .../libldap-2.4-2_2.4.28-1.1ubuntu4.4_amd64.deb) ...
Selecting previously unselected package libpipeline1.
Unpacking libpipeline1 (from .../libpipeline1_1.2.1-1_amd64.deb) ...
Selecting previously unselected package librtmp0.
Unpacking librtmp0 (from .../librtmp0_2.4~20110711.gitc28f1bab-1_amd64.deb) ...
Selecting previously unselected package openssl.
Unpacking openssl (from .../openssl_1.0.1-4ubuntu5.10_amd64.deb) ...
Selecting previously unselected package ca-certificates.
Unpacking ca-certificates (from .../ca-certificates_20111211_all.deb) ...
Selecting previously unselected package libcurl3.
Unpacking libcurl3 (from .../libcurl3_7.22.0-3ubuntu4.3_amd64.deb) ...
Selecting previously unselected package bsdmainutils.
Unpacking bsdmainutils (from .../bsdmainutils_8.2.3ubuntu1_amd64.deb) ...
Selecting previously unselected package groff-base.
Unpacking groff-base (from .../groff-base_1.21-7_amd64.deb) ...
Selecting previously unselected package libsasl2-modules.
Unpacking libsasl2-modules (from .../libsasl2-modules_2.1.25.dfsg1-3ubuntu0.1_amd64.deb) ...
Selecting previously unselected package man-db.
Unpacking man-db (from .../man-db_2.6.1-2ubuntu1_amd64.deb) ...
Selecting previously unselected package wget.
Unpacking wget (from .../wget_1.13.4-2ubuntu1_amd64.deb) ...
Selecting previously unselected package curl.
Unpacking curl (from .../curl_7.22.0-3ubuntu4.3_amd64.deb) ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up bash-completion (1:1.3-1ubuntu8.1) ...
Setting up libroken18-heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) ...
Setting up libasn1-8-heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) ...
Setting up libgpg-error0 (1.10-2ubuntu1) ...
Setting up libgcrypt11 (1.5.0-3ubuntu0.2) ...
Setting up libgdbm3 (1.8.3-10) ...
Setting up libp11-kit0 (0.12-2ubuntu1) ...
Setting up libtasn1-3 (2.10-1ubuntu1.1) ...
Setting up libgnutls26 (2.12.14-5ubuntu3.5) ...
Setting up libhcrypto4-heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) ...
Setting up libheimbase1-heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) ...
Setting up libwind0-heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) ...
Setting up libhx509-5-heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) ...
Setting up libkrb5-26-heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) ...
Setting up libheimntlm0-heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) ...
Setting up libgssapi3-heimdal (1.6~git20120311.dfsg.1-2ubuntu0.1) ...
Setting up libidn11 (1.23-2) ...
Setting up libsasl2-2 (2.1.25.dfsg1-3ubuntu0.1) ...
Setting up libldap-2.4-2 (2.4.28-1.1ubuntu4.4) ...
Setting up libpipeline1 (1.2.1-1) ...
Setting up librtmp0 (2.4~20110711.gitc28f1bab-1) ...
Setting up openssl (1.0.1-4ubuntu5.10) ...
Setting up ca-certificates (20111211) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Updating certificates in /etc/ssl/certs... 152 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
Setting up libcurl3 (7.22.0-3ubuntu4.3) ...
Setting up bsdmainutils (8.2.3ubuntu1) ...
update-alternatives: using /usr/bin/bsd-write to provide /usr/bin/write (write) in auto mode.
update-alternatives: using /usr/bin/bsd-from to provide /usr/bin/from (from) in auto mode.
Setting up groff-base (1.21-7) ...
Setting up libsasl2-modules (2.1.25.dfsg1-3ubuntu0.1) ...
Setting up man-db (2.6.1-2ubuntu1) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Building database of manual pages ...
Setting up wget (1.13.4-2ubuntu1) ...
Setting up curl (7.22.0-3ubuntu4.3) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
The base box was built successfully to /tmp/vagrant-lxc/boxes/output/vagrant-lxc-precise-amd64-2013-11-10.box
fgrehm commented 11 years ago

Oh, I was going to ask you something on the other issue but you gave me the answer on this one :P The problem is that you forgot to pass in the -E parameter to the ./build-ubuntu-box.sh script ;)

Here's how you should be using it:

PUPPET=1 sudo -E ./build-ubuntu-box.sh precise amd64

This is actually documented on the script and you missed out =/ Do you have any ideas on how I could make this more clear?

For now I'll close the issue but please LMK if it doesn't work for you so we can reopen it :)

abevoelker commented 11 years ago

Goddamnit. Yeah now it's working fine. -.-

Do you have any ideas on how I could make this more clear?

No, there's nothing you can do - it's documented both in the build scripts and in BOXES.md. Some amounts of stupidity just can't be stopped! :-)

fgrehm commented 11 years ago

@abevoelker Dont be so harsh with yourself :)