]> gitweb.fluxo.info Git - hydra.git/commitdiff
Init: generate puppet repository
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 3 Mar 2014 17:35:46 +0000 (14:35 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 3 Mar 2014 17:35:46 +0000 (14:35 -0300)
TODO.md
lib/hydra/git
share/hydra/init
share/hydractl/bootstrap

diff --git a/TODO.md b/TODO.md
index b84387bff8d646e4d591dc6bd07946fb7f752c93..8a5a90b9a5f72159f8da91c0294a48b31aa16420 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -4,6 +4,5 @@ TODO
 Hydra
 -----
 
-  - Init: generate puppet repository using "hydractl bootstrap repository"
   - Uniform syntax for specifying nodes (either by hostname or fqdn) on deploy and import-key.
   - Provision: wrapper for "hydractl provision" with stores/uses node configuration.
index 0908f5494194a918658153843a9fe54afb96c3ce..74bdc9a9d0e81b247be69817ad3f344b4024779b 100644 (file)
@@ -41,6 +41,7 @@ function hydra_git_init {
   fi
 
   (
+    echo "Initializing git repo $repo..."
     cd $repo
     git init
     git add .
index 69a0ef5b5d467eee2b61dfd819f9a38f63726a53..46c2de6358241fc9a4efb59b5fb58db6a9af401c 100755 (executable)
@@ -67,7 +67,16 @@ else
   fi
 
   # Create bootless repository
+  echo "Initializing bootless repository..."
   hydra $HYDRA bootless init
+
+  # Create puppet repository
+  echo "Cloning initial puppet repository..."
+  git clone git://git.sarava.org/puppet-bootstrap.git $BASEDIR/puppet
+
+  # Config puppet
+  echo "Configuring puppet repository..."
+  ( cd $BASEDIR/puppet && make submodules && make config )
 fi
 
 cat<<-EOF
index 6658e4e33dde3412e0d5796244b5953353585b59..c83a4b00b7cb66155295cd9b66c7dcd20660f3fd 100755 (executable)
@@ -21,14 +21,15 @@ STAGE="$1"
 if [ "$STAGE" == "repository" ]; then
   hydractl puppet-install
 
-  mkdir -p /etc/puppet/modules
-  git clone git://git.sarava.org/puppet-bootstrap /etc/puppet/modules/bootstrap
+  rm -rf /etc/puppet && git clone git://git.sarava.org/puppet-bootstrap /etc/puppet
+  chown -R puppet. /etc/puppet
 
-  echo "Editing /etc/puppet/modules/bootstrap/manifests/config.pp to suit your needs..."
+  echo "Please edit /etc/puppet/manifests/config.pp to suit your needs..."
+  echo "Press any key to continue, Ctrl-C to abort..."
+  read option
   $EDITOR /etc/puppet/modules/bootstrap/manifests/config.pp
 fi
 
 if [ -e "/etc/puppet/modules/bootstrap/manifests/$stage.pp" ]; then
-  puppet agent --no-daemonize --debug --verbose --onetime /etc/puppet/modules/bootstrap/manifests/$stage.pp
-  puppet agent --no-daemonize --debug --verbose
+  puppet apply /etc/puppet/modules/bootstrap/manifests/$stage.pp
 fi