Skip to content

Commit 6271d9b

Browse files
author
armab
committed
Change default linux user to Vagrant
Conform with some Vagrant system/login expectations
1 parent 2ca350f commit 6271d9b

File tree

3 files changed

+37
-12
lines changed

3 files changed

+37
-12
lines changed

Vagrantfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
Vagrant.configure("2") do |config|
5+
# config.ssh.insert_key = false
6+
config.ssh.username = 'vagrant'
7+
config.ssh.password = 'vagrant'
8+
config.vm.synced_folder '.', '/vagrant'
9+
10+
# VirtualBox.
11+
# `vagrant up virtualbox --provider=virtualbox`
12+
config.vm.define "virtualbox" do |virtualbox|
13+
virtualbox.vm.hostname = "stackstorm"
14+
virtualbox.vm.box = "file://builds/st2-v2.7.0_1523648841.box"
15+
virtualbox.vm.network :private_network, ip: "172.16.3.3"
16+
17+
config.vm.provider :virtualbox do |v|
18+
v.gui = false
19+
v.memory = 2048
20+
v.cpus = 2
21+
end
22+
config.vm.provision "shell", inline: "st2 --version"
23+
end
24+
25+
end

http/preseed.cfg

+9-9
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ d-i keyboard-configuration/layoutcode string us
2828
d-i keyboard-configuration/modelcode string pc105
2929
d-i debian-installer/locale string en_US.UTF-8
3030

31-
# Create ubuntu user account.
32-
d-i passwd/user-fullname string ubuntu
33-
d-i passwd/username string ubuntu
34-
d-i passwd/user-password password ubuntu
35-
d-i passwd/user-password-again password ubuntu
31+
# Create vagrant user account.
32+
d-i passwd/user-fullname string vagrant
33+
d-i passwd/username string vagrant
34+
d-i passwd/user-password password vagrant
35+
d-i passwd/user-password-again password vagrant
3636
d-i user-setup/allow-password-weak boolean true
3737
d-i user-setup/encrypt-home boolean false
38-
d-i passwd/user-default-groups ubuntu sudo
38+
d-i passwd/user-default-groups vagrant sudo
3939
d-i passwd/user-uid string 900
4040

4141
d-i preseed/late_command string \
42-
echo 'ubuntu ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/ubuntu && \
43-
echo 'Defaults:ubuntu !requiretty' >> /target/etc/sudoers.d/ubuntu && \
44-
chmod 0440 /target/etc/sudoers.d/ubuntu
42+
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/vagrant && \
43+
echo 'Defaults:vagrant !requiretty' >> /target/etc/sudoers.d/vagrant && \
44+
chmod 0440 /target/etc/sudoers.d/vagrant

st2.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@
6868
],
6969
"iso_checksum_type": "sha256",
7070
"iso_checksum": "0a03608988cfd2e50567990dc8be96fb3c501e198e2e6efcb846d89efc7b89f2",
71-
"ssh_username": "ubuntu",
72-
"ssh_password": "ubuntu",
71+
"ssh_username": "vagrant",
72+
"ssh_password": "vagrant",
7373
"ssh_port": 22,
7474
"ssh_wait_timeout": "10000s",
75-
"shutdown_command": "echo 'ubuntu'|sudo -S shutdown -P now",
75+
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
7676
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
7777
"virtualbox_version_file": ".vbox_version",
7878
"vm_name": "{{user `vm_name`}}",

0 commit comments

Comments
 (0)