aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-04 12:05:56 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-04 12:05:56 -0300
commit4c1bab861dba2f1d8bca76b5545729189a508f54 (patch)
tree7bb30e3c3b065ee1b28855ceba7ef320340aa9e3
parent3f871bf28d79fd2446f8f07e10249b288b7bbc6e (diff)
downloadpuppet-bootstrap-4c1bab861dba2f1d8bca76b5545729189a508f54.tar.gz
puppet-bootstrap-4c1bab861dba2f1d8bca76b5545729189a508f54.tar.bz2
Make deps target
-rw-r--r--Makefile3
-rw-r--r--README.md1
-rw-r--r--TODO.md2
-rwxr-xr-xbin/dependencies23
-rwxr-xr-xbin/provision21
5 files changed, 32 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index b50f868..9bf88d0 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,9 @@ CWD = $(shell pwd)
all: clean remote modules
+deps:
+ bin/dependencies
+
modules:
mr up
diff --git a/README.md b/README.md
index 80b93c0..ca4843a 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,7 @@ You'll basically use the `bootstrap` repository as your `puppet` repository:
git clone git://git.sarava.org/puppet-bootstrap.git puppet
cd puppet && git tag -v # check integrity
+ make deps # install dependencies
make submodules # add all needed puppet module as as git submodules
make config # basic configuration
diff --git a/TODO.md b/TODO.md
index e58d534..0b26d1a 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,8 +1,6 @@
TODO
====
-* Make `deps` target:
- * Installs all needed packages (puppet, ruby-hiera-puppet, mr, etc).
* Make `config` target:
* Check if already ran.
* Move from `config.pp` to hiera.
diff --git a/bin/dependencies b/bin/dependencies
new file mode 100755
index 0000000..148ab84
--- /dev/null
+++ b/bin/dependencies
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# Simple shell provisioner for Vagrant instances.
+#
+
+# Install a package, thanks to the Hydra Suite.
+function provision_package {
+ if [ -z "$1" ]; then
+ return
+ fi
+
+ dpkg -s $1 &> /dev/null
+
+ if [ "$?" == "1" ]; then
+ echo "Installing package $1..."
+ DEBIAN_FRONTEND=noninteractive apt-get install $1 -y
+ fi
+}
+
+# Ensure basic packages are installed.
+for package in puppet ruby-hiera-puppet mr; do
+ provision_package $package
+done
diff --git a/bin/provision b/bin/provision
index fa76b53..4d096b8 100755
--- a/bin/provision
+++ b/bin/provision
@@ -3,25 +3,14 @@
# Simple shell provisioner for Vagrant instances.
#
-# Install a package, thanks to the Hydra Suite.
-function provision_package {
- if [ -z "$1" ]; then
- return
- fi
-
- dpkg -s $1 &> /dev/null
-
- if [ "$?" == "1" ]; then
- echo "Installing package $1..."
- DEBIAN_FRONTEND=noninteractive apt-get install $1 -y
- fi
-}
-
# Ensure the system is updated.
sudo apt-get update && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean
-# Ensure basic packages are installed.
-for package in sqlite3 libsqlite3-ruby ruby-hiera-puppet libactiverecord-ruby ruby-sqlite3 usbutils; do
+# Install dependencies
+source /vagrant/puppet/bin/dependencies
+
+# Ensure additional dependencies are installed.
+for package in sqlite3 libsqlite3-ruby libactiverecord-ruby ruby-sqlite3 usbutils; do
provision_package $package
done