make vagrant user configurable from config.yaml
RELATED_BUG: 1569237 RELATED_BUG: 1589721 Change-Id: I57b5c9ea124b071c6d31b8c825c9cb1d2e89a8ce
This commit is contained in:
parent
c109cd09a9
commit
20b2965fd9
1
Vagrantfile
vendored
1
Vagrantfile
vendored
@ -69,6 +69,7 @@ def configure_vm(name, vm, conf)
|
|||||||
"is_compute" => (name != "manager"),
|
"is_compute" => (name != "manager"),
|
||||||
"use_ldap" => conf["use_ldap"] || false,
|
"use_ldap" => conf["use_ldap"] || false,
|
||||||
"extra_images" => conf["extra_images"] || "",
|
"extra_images" => conf["extra_images"] || "",
|
||||||
|
"vagrant_username" => conf["vagrant_username"] || "ubuntu",
|
||||||
}
|
}
|
||||||
# add all the rest of the content in the conf file
|
# add all the rest of the content in the conf file
|
||||||
conf.each do |k, v|
|
conf.each do |k, v|
|
||||||
|
@ -40,6 +40,9 @@ bridge_int: eth1
|
|||||||
#box_name: 'my.favorite'
|
#box_name: 'my.favorite'
|
||||||
#box_url: http://gallifrey/vagrant/devstack-2014-02-19.box
|
#box_url: http://gallifrey/vagrant/devstack-2014-02-19.box
|
||||||
|
|
||||||
|
# Vagrant username used in box image, e.g. ubuntu
|
||||||
|
#vagrant_username: vagrant
|
||||||
|
|
||||||
# Non upstream Git URL to fetch Devstack from instead.
|
# Non upstream Git URL to fetch Devstack from instead.
|
||||||
#devstack_git: /home/vagrant/openstack/devstack
|
#devstack_git: /home/vagrant/openstack/devstack
|
||||||
|
|
||||||
@ -69,6 +72,10 @@ bridge_int: eth1
|
|||||||
#ip_address_manager: 10.0.10.10
|
#ip_address_manager: 10.0.10.10
|
||||||
#ip_address_compute: 10.0.10.20
|
#ip_address_compute: 10.0.10.20
|
||||||
|
|
||||||
|
# Name of network interface in virtual machine - e.g. enp0s8 in ubuntu
|
||||||
|
#guest_interface_default: eth1
|
||||||
|
#host_ip_iface: eth1
|
||||||
|
|
||||||
# Extra images to download and add to glance, a list of url's comma separated
|
# Extra images to download and add to glance, a list of url's comma separated
|
||||||
# for new images to be added to glance
|
# for new images to be added to glance
|
||||||
#extra_images: https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img,https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img
|
#extra_images: https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img,https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
node default {
|
node default {
|
||||||
include base
|
include base
|
||||||
include user::stack
|
include user::stack
|
||||||
include user::vagrant
|
class {'user::vagrant':
|
||||||
|
username => $::vagrant_username,
|
||||||
|
}
|
||||||
include grenade
|
include grenade
|
||||||
include devstack
|
include devstack
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,14 @@ class user::vagrant(
|
|||||||
$username = 'vagrant'
|
$username = 'vagrant'
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
file {'/home/vagrant/.bashrc':
|
file {"/home/${username}/.bashrc":
|
||||||
owner => $username,
|
owner => $username,
|
||||||
group => $username,
|
group => $username,
|
||||||
mode => '0644',
|
mode => '0644',
|
||||||
source => 'puppet:///modules/user/stack_bashrc',
|
source => 'puppet:///modules/user/stack_bashrc',
|
||||||
}
|
}
|
||||||
|
|
||||||
file {'/home/vagrant/devstack':
|
file {"/home/${username}/devstack":
|
||||||
owner => $username,
|
owner => $username,
|
||||||
group => $username,
|
group => $username,
|
||||||
mode => '0644',
|
mode => '0644',
|
||||||
@ -20,7 +20,7 @@ class user::vagrant(
|
|||||||
target => '/home/stack/devstack',
|
target => '/home/stack/devstack',
|
||||||
}
|
}
|
||||||
|
|
||||||
file {'/home/vagrant/grenade':
|
file {"/home/${username}/grenade":
|
||||||
owner => $username,
|
owner => $username,
|
||||||
group => $username,
|
group => $username,
|
||||||
mode => '0644',
|
mode => '0644',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user