Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Vagrantfile to resolve package update/installation issue. #9783

Merged
merged 2 commits into from
Dec 7, 2016

Conversation

kwilczynski
Copy link
Contributor

Signed-off-by: Krzysztof Wilczynski krzysztof.wilczynski@linux.com

@cblecker
Copy link
Contributor

cblecker commented Nov 1, 2016

Lots of things are changing here.. I'm wondering what the goal is, or what problem is trying to be solved with these changes.

@kwilczynski kwilczynski force-pushed the fix/update-Vagrantfile branch 3 times, most recently from 9503e50 to 1cfbeb2 Compare November 1, 2016 21:26
@kwilczynski
Copy link
Contributor Author

Resolves #9763.

@kwilczynski
Copy link
Contributor Author

Manually tested, seem to be working fine:

$ vagrant up --provider virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Cloning VM...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: terraform_default_1478036004446_75258
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Mounting shared folders...
    default: /opt/gopath/src/github.com/hashicorp/terraform => /Users/krzysztof/Development/Projects/Personal/Go/src/github.com/hashicorp/terraform
==> default: Running provisioner: prepare-shell (shell)...
    default: Running: inline script
==> default: Running provisioner: initial-setup (shell)...
    default: Running: inline script
==> default: Upgrading packages ...
==> default: Installing prerequisites ...
==> default: Downloading go (1.7.3) ...
==> default: Setting up go (1.7.3) ...

@kwilczynski
Copy link
Contributor Author

Checking upon boot:

$ vagrant ssh
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-96-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Tue Nov  1 21:33:43 UTC 2016

  System load:  0.37              Processes:           96
  Usage of /:   3.0% of 38.52GB   Users logged in:     0
  Memory usage: 2%                IP address for eth0: 10.0.2.15
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

vagrant@terraform:/opt/gopath/src/github.com/hashicorp/terraform$ go version
go version go1.7.3 linux/amd64

Copy link
Contributor

@cblecker cblecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of these changes seem complex and I'd suggest further discussion. It looks like the referenced issue is cosmetic, and the Vagrantfile still works without any changes. However to clean them up and get the provisioning script to behave better, we could add those Dpkg::Options to Line 24.

I'd also note that the Vagrantfile was only just recently refactored in #8762.

@@ -1,83 +1,108 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to remove the version variable?


# Get the ARCH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove the comments? They can help either debug and allow others to contribute.

echo "Downloading go (${GOVERSION}) ..."
wget -P /tmp --quiet "https://storage.googleapis.com/golang/go${GOVERSION}.linux-${ARCH}.tar.gz"
wget -P /tmp -q --no-check-certificate \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should always be checking the certificate. This is a very dangerous flag to set.

config.vm.synced_folder '.', '/opt/gopath/src/github.com/hashicorp/terraform'

config.vm.provider "docker" do |v, override|
override.vm.box = "tknerr/baseimage-ubuntu-14.04"
if config.vm.respond_to? :use_linked_clone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding sections around linked clones?


# Setup the GOPATH; even though the shared folder spec gives the working
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all helpful comments, and likely shouldn't be removed.

# parent path to allow subsequent "go get" commands to work.
mkdir -p "$SRCPATH"
chown -R vagrant:vagrant "$SRCPATH" 2>/dev/null || true
# ^^ silencing errors here because we expect this to fail for the shared folder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Especially this comment, which explains why we're silencing errors.

export DEBIAN_PRIORITY=critical
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
APT_OPTS="--yes --force-yes --no-install-suggests --no-install-recommends"

APT_OPTIONS='--assume-yes --no-install-suggests --no-install-recommends'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with moving from --force-yes to --assume-yes.

Could we not simply modify this line to the following to resolve the issue? This would preclude the need for major changes to the rest of the file.

APT_OPTS="--assume-yes --no-install-suggests --no-install-recommends -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\""

@kwilczynski kwilczynski force-pushed the fix/update-Vagrantfile branch 2 times, most recently from 5e2778e to 2d908d2 Compare November 1, 2016 22:50
@kwilczynski
Copy link
Contributor Author

@cblecker hi there!

I am sorry that you have felt so strongly about the changes here. I will remove everything and put only the necessary alternations.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
@kwilczynski
Copy link
Contributor Author

@cblecker hi there.

Changes as suggested by you.

@kwilczynski kwilczynski changed the title Re-factor the Vagrantfile. Update the Vagrantfile to resolve package update/installation issue. Nov 3, 2016
Copy link
Contributor

@cblecker cblecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kwilczynski!

I'm sorry if I came off too strong. I don't mean to shut down all those changes if they had a reason.. it's just the reasons weren't obvious and weren't commented. I actually liked the assume-yes APT_OPTS change (commented again in-line).

That being said, I've tested this pull as-is, and it fixes the issue on my side (Vagrant 1.8, Parallels, bento/ubuntu-14.04 version 2.3.0).

@@ -16,7 +16,7 @@ ARCH="$(uname -m | sed 's|i686|386|' | sed 's|x86_64|amd64|')"
export DEBIAN_PRIORITY=critical
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
APT_OPTS="--yes --force-yes --no-install-suggests --no-install-recommends"
APT_OPTS="--yes --force-yes --no-install-suggests --no-install-recommends -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually liked changing --yes --force-yes to --assume-yes as it's more graceful, and the man page actually suggests not using force.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
@kwilczynski
Copy link
Contributor Author

kwilczynski commented Nov 3, 2016

@cblecker hi there. Changes applied as per your suggestions.

Again, apologies for making you upset.

@kwilczynski
Copy link
Contributor Author

@cblecker hi there!

I have a question - would you really mind some of the additions to the Vagrantfile? I would like to add the part which enables linked clone. I see why not to? It adds the speed benefits and it should be harmless (given the if-statement there). What do you think?

@stack72
Copy link
Contributor

stack72 commented Dec 7, 2016

LGTM! Thanks for the back and forth coming to an agreement here @kwilczynski and @cblecker :)

@stack72 stack72 added the build Auto-pinning label Dec 7, 2016
@stack72 stack72 merged commit 0ab0519 into hashicorp:master Dec 7, 2016
ojongerius added a commit to atlassian/terraform that referenced this pull request Dec 8, 2016
…dentials

* upstream/master: (79 commits)
  update CHANGELOG
  Update panicwrap to pass through all interrupt signals
  Gracefully stops on SIGTERM
  website: update website for conditionals
  vendor: update HIL with conditionals
  Keep a consistent provider order.
  Update CHANGELOG.md
  provider/aws: Forces the api gateway domain name certificates to recreate the resource (hashicorp#10588)
  Update CHANGELOG.md
  provider/aws: FIxed the api_gw_domain_name replace operation (hashicorp#10179)
  Fixed note formatting
  Explicitly say `count` is not supported by modules (hashicorp#10553)
  docs/aws: Fix the discrepencies of the emr_cluster documentation (hashicorp#10578)
  Update CHANGELOG.md
  Service role is not updated on AWS for a CodeDeploy deployment group (hashicorp#9866)
  Update CHANGELOG.md
  provider/datadog hashicorp#9375: Refactor tags to a list instead of a map. (hashicorp#10570)
  Update the Vagrantfile to resolve package update/installation issue. (hashicorp#9783)
  docs/aws: Add iam_server_certificate data source to nav bar (hashicorp#10576)
  Update CHANGELOG.md
  ...
pielu pushed a commit to pielu/terraform that referenced this pull request Dec 20, 2016
* aws/feature/r-instance-net-iface-id: (74 commits)
  - Properly exercise network_interface_id from AWS SDK - Update Terraform’s documentation
  Update CHANGELOG.md
  provider/aws: Forces the api gateway domain name certificates to recreate the resource (hashicorp#10588)
  Update CHANGELOG.md
  provider/aws: FIxed the api_gw_domain_name replace operation (hashicorp#10179)
  Fixed note formatting
  Explicitly say `count` is not supported by modules (hashicorp#10553)
  docs/aws: Fix the discrepencies of the emr_cluster documentation (hashicorp#10578)
  Update CHANGELOG.md
  Service role is not updated on AWS for a CodeDeploy deployment group (hashicorp#9866)
  Update CHANGELOG.md
  provider/datadog hashicorp#9375: Refactor tags to a list instead of a map. (hashicorp#10570)
  Update the Vagrantfile to resolve package update/installation issue. (hashicorp#9783)
  docs/aws: Add iam_server_certificate data source to nav bar (hashicorp#10576)
  Update CHANGELOG.md
  feat/aws: add iam_server_certificate data source (hashicorp#10558)
  provider/azurerm: arm_virtual_machine panic fix
  Update .travis.yml
  provider/aws: Improved the documentation for EMR Cluster (hashicorp#10563)
  provider/azurerm: Do not pass an empty string of license_type to AMR VMs (hashicorp#10564)
  ...

# Conflicts:
#	builtin/providers/aws/resource_aws_instance.go
dbarach pushed a commit to fdio-stack/vpp-mirror that referenced this pull request Dec 21, 2016
The dpkg sudo trigger appears to want to run interactively despite the noninteractive
debconf setting. This is a problem upstream for vagrant also, see.

hashicorp/terraform#9763

Incorporating the recommended fix to Vagrantfile from upstream

hashicorp/terraform#9783

Change-Id: I8da8522fc9e80fc3bd268b347a786054ad019170
Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
@ghost
Copy link

ghost commented Apr 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Auto-pinning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants