core: create sentinel just before provisioning [GH-2488]
This commit is contained in:
parent
3219be3d51
commit
5f1cf5872f
|
@ -53,6 +53,7 @@ BUG FIXES:
|
||||||
- core: Don't load Vagrantfile on `vagrant plugin` commands, allowing
|
- core: Don't load Vagrantfile on `vagrant plugin` commands, allowing
|
||||||
Vagrantfiles that use plugins to work. [GH-2388]
|
Vagrantfiles that use plugins to work. [GH-2388]
|
||||||
- core: global flags are ignored past the "--" on the CLI. [GH-2491]
|
- core: global flags are ignored past the "--" on the CLI. [GH-2491]
|
||||||
|
- core: provisoining will properly happen if `up` failed. [GH-2488]
|
||||||
- guests/freebsd: Mounting NFS folders works. [GH-2400]
|
- guests/freebsd: Mounting NFS folders works. [GH-2400]
|
||||||
- guests/freebsd: Uses `sh` by default for shell. [GH-2485]
|
- guests/freebsd: Uses `sh` by default for shell. [GH-2485]
|
||||||
- guests/redhat: Down interface before messing up configuration file
|
- guests/redhat: Down interface before messing up configuration file
|
||||||
|
|
|
@ -28,17 +28,14 @@ module Vagrant
|
||||||
# Check if we already provisioned, and if so, disable the rest
|
# Check if we already provisioned, and if so, disable the rest
|
||||||
ignore_sentinel = true
|
ignore_sentinel = true
|
||||||
ignore_sentinel = env[:provision_ignore_sentinel] if env.has_key?(:provision_ignore_sentinel)
|
ignore_sentinel = env[:provision_ignore_sentinel] if env.has_key?(:provision_ignore_sentinel)
|
||||||
|
sentinel_path = nil
|
||||||
|
|
||||||
if !ignore_sentinel
|
if !ignore_sentinel
|
||||||
@logger.info("Checking provisioner sentinel if we should run...")
|
@logger.info("Checking provisioner sentinel if we should run...")
|
||||||
sentinel = env[:machine].data_dir.join("action_provision")
|
sentinel_path = env[:machine].data_dir.join("action_provision")
|
||||||
if sentinel.file?
|
if sentinel_path.file?
|
||||||
@logger.info("Sentinel found! Not provisioning.")
|
@logger.info("Sentinel found! Not provisioning.")
|
||||||
enabled = false
|
enabled = false
|
||||||
else
|
|
||||||
@logger.info("Sentinel not found.")
|
|
||||||
sentinel.open("w") do |f|
|
|
||||||
f.write(Time.now.to_i.to_s)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -58,6 +55,14 @@ module Vagrant
|
||||||
# Continue, we need the VM to be booted.
|
# Continue, we need the VM to be booted.
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
||||||
|
# Write the sentinel if we have to
|
||||||
|
if sentinel_path && !sentinel_path.file?
|
||||||
|
@logger.info("Writing provisioning sentinel so we don't provision again")
|
||||||
|
sentinel_path.open("w") do |f|
|
||||||
|
f.write(Time.now.to_i.to_s)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Actually provision if we enabled it
|
# Actually provision if we enabled it
|
||||||
if enabled
|
if enabled
|
||||||
type_map = provisioner_type_map(env)
|
type_map = provisioner_type_map(env)
|
||||||
|
|
Loading…
Reference in New Issue