Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autoradio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ale
autoradio
Commits
fed952b8
Commit
fed952b8
authored
9 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
update Vagrant test env for etcd 2
parent
27b8ee93
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vagrant-test/Vagrantfile
+30
-8
30 additions, 8 deletions
vagrant-test/Vagrantfile
vagrant-test/bootstrap-local.sh
+9
-5
9 additions, 5 deletions
vagrant-test/bootstrap-local.sh
with
39 additions
and
13 deletions
vagrant-test/Vagrantfile
+
30
−
8
View file @
fed952b8
...
@@ -5,6 +5,10 @@
...
@@ -5,6 +5,10 @@
# if you want to use local packages, in which case the 'etcd' and
# if you want to use local packages, in which case the 'etcd' and
# 'autoradio' packages should be placed in the same directory as this
# 'autoradio' packages should be placed in the same directory as this
# file.
# file.
#
# If you have an APT proxy available, you can set the APT_PROXY environment
# variable to its host:port address, and the VMs will use it to retrieve
# Debian packages. This will make the setup step faster.
API_VERSION
=
"2"
API_VERSION
=
"2"
...
@@ -19,12 +23,33 @@ cat >/etc/hosts <<EOF
...
@@ -19,12 +23,33 @@ cat >/etc/hosts <<EOF
EOF
EOF
SCRIPT
SCRIPT
# Static configuration for etcd.
$setup_etcd
=
<<
SCRIPT
cat >/etc/default/etcd <<EOF
START=1
ETCD_INITIAL_CLUSTER_STATE=new
ETCD_INITIAL_CLUSTER=node1=http://192.168.50.2:2380,node2=http://192.168.50.3:2380,node3=http://192.168.50.4:2380
EOF
SCRIPT
# Setup apt proxy.
$setup_apt_proxy
=
<<
SCRIPT
cat >/etc/apt/apt.conf.d/000apt-proxy <<EOF
Acquire::http::Proxy "http://
#{
ENV
[
'APT_PROXY'
]
}
/";
Acquire::http::Pipeline-Depth "23";
EOF
SCRIPT
Vagrant
.
configure
(
API_VERSION
)
do
|
config
|
Vagrant
.
configure
(
API_VERSION
)
do
|
config
|
config
.
vm
.
box
=
"
debian-
wheezy
-64
"
config
.
vm
.
box
=
"wheezy"
config
.
vm
.
box_url
=
"http://
basebox.libera.cc
/debian-wheezy-64.box"
config
.
vm
.
box_url
=
"http://
www.incal.net/ale
/debian-wheezy-64.box"
config
.
vm
.
provision
"shell"
,
inline:
$setup_host_file
config
.
vm
.
provision
"shell"
,
inline:
$setup_host_file
if
!
ENV
[
'APT_PROXY'
].
nil?
config
.
vm
.
provision
"shell"
,
inline:
$setup_apt_proxy
end
config
.
vm
.
provision
"shell"
do
|
s
|
config
.
vm
.
provision
"shell"
do
|
s
|
if
ENV
[
'LOCAL'
].
nil?
if
ENV
[
'LOCAL'
].
nil?
s
.
path
=
"bootstrap.sh"
s
.
path
=
"bootstrap.sh"
...
@@ -37,22 +62,19 @@ Vagrant.configure(API_VERSION) do |config|
...
@@ -37,22 +62,19 @@ Vagrant.configure(API_VERSION) do |config|
config
.
vm
.
define
"node1"
do
|
m
|
config
.
vm
.
define
"node1"
do
|
m
|
m
.
vm
.
hostname
=
"node1"
m
.
vm
.
hostname
=
"node1"
m
.
vm
.
network
"private_network"
,
ip:
"192.168.50.2"
m
.
vm
.
network
"private_network"
,
ip:
"192.168.50.2"
m
.
vm
.
provision
"shell"
,
m
.
vm
.
provision
"shell"
,
inline:
$setup_etcd
inline:
"echo BOOTSTRAP=1 > /etc/default/etcd"
end
end
config
.
vm
.
define
"node2"
do
|
m
|
config
.
vm
.
define
"node2"
do
|
m
|
m
.
vm
.
hostname
=
"node2"
m
.
vm
.
hostname
=
"node2"
m
.
vm
.
network
"private_network"
,
ip:
"192.168.50.3"
m
.
vm
.
network
"private_network"
,
ip:
"192.168.50.3"
m
.
vm
.
provision
"shell"
,
m
.
vm
.
provision
"shell"
,
inline:
$setup_etcd
inline:
"echo ETCD_SERVER=node1 > /etc/default/etcd"
end
end
config
.
vm
.
define
"node3"
do
|
m
|
config
.
vm
.
define
"node3"
do
|
m
|
m
.
vm
.
hostname
=
"node3"
m
.
vm
.
hostname
=
"node3"
m
.
vm
.
network
"private_network"
,
ip:
"192.168.50.4"
m
.
vm
.
network
"private_network"
,
ip:
"192.168.50.4"
m
.
vm
.
provision
"shell"
,
m
.
vm
.
provision
"shell"
,
inline:
$setup_etcd
inline:
"echo ETCD_SERVER=node1 > /etc/default/etcd"
# Create a test mountpoint.
# Create a test mountpoint.
m
.
vm
.
provision
"shell"
,
m
.
vm
.
provision
"shell"
,
...
...
This diff is collapsed.
Click to expand it.
vagrant-test/bootstrap-local.sh
+
9
−
5
View file @
fed952b8
...
@@ -11,24 +11,28 @@ EOF
...
@@ -11,24 +11,28 @@ EOF
most_recent_match
()
{
most_recent_match
()
{
local
pattern
=
"
$1
"
local
pattern
=
"
$1
"
ls
-
t
${
pattern
}
|
head
-1
ls
-
1rv
${
pattern
}
|
head
-1
}
}
# Install the required packages.
# Install the required packages.
export
DEBIAN_FRONTEND
=
noninteractive
export
DEBIAN_FRONTEND
=
noninteractive
apt-get
-q
update
apt-get
-q
update
yes
N 2>/dev/null | apt-get
install
-q
-y
runit icecast2 libcap2-bin liquidsoap
yes
N 2>/dev/null | apt-get
install
-q
-y
runit icecast2 libcap2-bin liquidsoap
dpkg
-i
$(
most_recent_match /vagrant/etcd_
*
.deb
)
etcd_pkg
=
$(
most_recent_match
'/vagrant/etcd_*.deb'
)
dpkg
-i
$(
most_recent_match /vagrant/autoradio_
*
.deb
)
echo
"Found etcd package:
${
etcd_pkg
}
"
>
&2
dpkg
-i
${
etcd_pkg
}
autoradio_pkg
=
$(
most_recent_match
'/vagrant/autoradio_*.deb'
)
echo
"Found autoradio package:
${
autoradio_pkg
}
"
>
&2
dpkg
-i
${
autoradio_pkg
}
# Install the configuration.
# Install the configuration.
DOMAIN
=
"
${
DOMAIN
:-
$1
}
"
DOMAIN
=
"
${
DOMAIN
:-
$1
}
"
if
[
-n
"
${
DOMAIN
}
"
]
;
then
if
[
-n
"
${
DOMAIN
}
"
]
;
then
echo
"Autoconfigured with domain:
${
DOMAIN
}
"
1
>&2
echo
"Autoconfigured with domain:
${
DOMAIN
}
"
>
&2
echo
"DOMAIN=
${
DOMAIN
}
"
>
/etc/default/autoradio
echo
"DOMAIN=
${
DOMAIN
}
"
>
/etc/default/autoradio
fi
fi
echo
"REDIRECTORD_OPTIONS=
\"
--enable-icecast-proxy
\"
"
>>
/etc/default/autoradio
echo
"REDIRECTORD_OPTIONS=
\"
--enable-icecast-proxy
\"
"
>>
/etc/default/autoradio
echo
"All done (?)"
1
>&2
echo
"All done (?)"
>
&2
exit
0
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment