Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Vagrantfile cleanup #1332

Merged
merged 5 commits into from
Apr 26, 2017
Merged

Conversation

oxyc
Copy link
Collaborator

@oxyc oxyc commented Apr 23, 2017

Inspired by roots/trellis#828.

A first stab at a simple Vagrantfile logic split. Thoughts?

@@ -1,6 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2' unless defined? VAGRANTFILE_API_VERSION
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't really see the point of defining this when it could technically be overridden by an earlier vagrant command.

Copy link
Owner

Choose a reason for hiding this comment

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

+1

Vagrantfile Outdated
config.vm.network :public_network, ip: vconfig['vagrant_public_ip']
if vconfig['vagrant_public_ip']
config.vm.network :public_network,
ip: vconfig['vagrant_public_ip'] != '0.0.0.0' ? vconfig['vagrant_public_ip'] : nil
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My personal preference but I know some prefer to avoid ternary expressions so let me know if you want me to revert it. Also I'm only assuming nil will be the same as not setting the option at all. Should verify that.

Vagrantfile Outdated
}
if synced_folder.include?('options_override')
synced_folder['options_override'].each do |key, value|
options[key.to_sym] = value
end
end
config.vm.synced_folder synced_folder['local_path'], synced_folder['destination'], options
config.vm.synced_folder synced_folder.fetch('local_path'), synced_folder.fetch('destination'), options
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As these keys are required, it will now throw a key not found (KeyError) if not set.

@oxyc oxyc force-pushed the vagrantfile-cleanup branch 3 times, most recently from e4f41aa to 9b15f62 Compare April 23, 2017 05:52
@oxyc oxyc force-pushed the vagrantfile-cleanup branch 2 times, most recently from 19c9b2d to 2df9583 Compare April 23, 2017 05:55
@oxyc oxyc changed the title [WIP] Vagrantfile cleanup Vagrantfile cleanup Apr 23, 2017
ConditionalAssignment: No way
IndentArray: No way
AlignParameters: No way
rsync__auto is true by default already.
rsync__args has --copy-links as a default.
@geerlingguy geerlingguy added this to the 4.5.0 milestone Apr 23, 2017
@geerlingguy
Copy link
Owner

While we're on the 'potential to break small things' release train... I'll loop this into the 4.5.0 release as well.

@geerlingguy geerlingguy merged commit f27806c into geerlingguy:master Apr 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants