Skip to content

Commit

Permalink
move aeolus-node off of the PATH as it isn't an end-user executable
Browse files Browse the repository at this point in the history
  • Loading branch information
movitto committed Sep 21, 2011
1 parent caa9608 commit 8e85f17
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/aeolus-cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
puppet /usr/share/aeolus-configure/modules/aeolus/aeolus.pp \
--modulepath=/usr/share/aeolus-configure/modules/ \
--external_nodes "/usr/sbin/aeolus-node $PUPPET_NODE" --node_terminus exec \
--external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node $PUPPET_NODE" --node_terminus exec \
--logdest=/var/log/aeolus-configure/aeolus-cleanup.log \
--logdest=console \
$LOGLEVEL
2 changes: 1 addition & 1 deletion bin/aeolus-configure
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
puppet /usr/share/aeolus-configure/modules/aeolus/aeolus.pp \
--modulepath=/usr/share/aeolus-configure/modules/ \
--external_nodes "/usr/sbin/aeolus-node $PUPPET_NODE" --node_terminus exec \
--external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node $PUPPET_NODE" --node_terminus exec \
--logdest=/var/log/aeolus-configure/aeolus-configure.log \
--logdest=console \
$LOGLEVEL
Empty file modified bin/aeolus-node
100644 → 100755
Empty file.
86 changes: 86 additions & 0 deletions bin/cloud.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/ruby
# setup repositories, download/install aeolus, run interactive config, bring up wui
# must be run as the super user
# TODO other distro support

require 'optparse'

Signal.trap("INT") do
puts ""
exit 1
end

colors = {:reset => "\e[0m",
:bold => "\e[1m",
:black => "\e[30m",
:red => "\e[31m",
:blue => "\e[34m",
:green => "\e[32m"}

puts "#{colors[:bold]}To The Cloud!....#{colors[:reset]}"

options = {:deploy => false,
:migrate => false,
:scale => false}

optparse = OptionParser.new do |opts|
opts.banner = "#{colors[:bold]}Usage: cloud.rb [options]"
opts.on("-d", "--deploy", "Deploy new instances to the cloud") { options[:deploy] = true }
opts.on("-m", "--migrate", "Migrate existing instances from one cloud provider to another") { options[:migrate] = true }
opts.on("-s", "--scale", "Scale existing instances accross cloud providers") { options[:scale] = true }
opts.on("-h", "--help", 'Display this message' ) { puts opts ; exit 0 }
end

optparse.parse!

options[:deploy] = true unless options.values.include? true

####################
puts "#{colors[:blue]}setting up repositories..."

FEDORA="14"

REPOS={:testing => "http://repos.fedorapeople.org/repos/aeolus/conductor/testing/fedora-$releasever/$basearch/",
:expiremental => "http://yum.morsi.org/aeolus/",
:deltacloud => "http://devel.mifo.sk/deltacloud/current/$basearch"}

File.open("/etc/yum.repos.d/aeolus.repo", "w"){ |f|
REPOS.each { |n,r|
repo = "[aeolus_#{n}]\n" +
"name=aeolus_#{n}\n" +
"baseurl=#{r}\n" +
"enabled=1\n" +
"skip_if_unavailable=1\n" +
"gpgcheck=0\n"
f.write repo
puts "Created aeolus_#{n}"
}
}

puts "#{colors[:green]}Done\n\n"

#####################
puts "#{colors[:blue]}installing packages............"

IO.popen("yum install deltacloud-core-all aeolus-all -y") do |p|
while l = p.gets do
puts l
end
end

puts "#{colors[:green]}Done\n\n"

#####################
puts "#{colors[:blue]}launching configure............"

# just fork/exec here to handle stdin
fork{
exec "/usr/sbin/aeolus-configure -i #{options.collect { |o| "--#{o}" }.join(" ")}"
}
Process.wait

puts "#{colors[:green]}Done\n\n"

# TODO open up web browser to conductor

puts "#{colors[:reset]}"
3 changes: 1 addition & 2 deletions contrib/aeolus-configure.spec
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@ Aeolus Configure Puppet Recipe
%{__cp} -R %{pbuild}/recipes/ntp/ %{buildroot}/%{aeolushome}/modules/ntp
%{__cp} -R %{pbuild}/recipes/openssl/ %{buildroot}/%{aeolushome}/modules/openssl
%{__cp} -R %{pbuild}/recipes/postgres/ %{buildroot}/%{aeolushome}/modules/postgres
%{__cp} -R %{pbuild}/bin/aeolus-node %{buildroot}/%{aeolushome}/modules/aeolus/
%{__cp} -R %{pbuild}/bin/aeolus-check-services %{buildroot}/%{_bindir}/
%{__cp} -R %{pbuild}/bin/aeolus-restart-services %{buildroot}/%{_sbindir}/
%{__cp} -R %{pbuild}/bin/aeolus-configure-image %{buildroot}/%{_sbindir}/
%{__cp} -R %{pbuild}/bin/aeolus-configure %{buildroot}/%{_sbindir}/
%{__cp} -R %{pbuild}/bin/aeolus-cleanup %{buildroot}/%{_sbindir}/
%{__cp} -R %{pbuild}/bin/aeolus-node %{buildroot}/%{_sbindir}/

%files
%doc COPYING
%attr(0755, root, root) %{_sbindir}/aeolus-configure
%attr(0755, root, root) %{_sbindir}/aeolus-cleanup
%attr(0755, root, root) %{_sbindir}/aeolus-node
%config(noreplace) %{_sysconfdir}/aeolus-configure/*
%attr(0755, root, root) %{_bindir}/aeolus-check-services
%attr(0755, root, root) %{_sbindir}/aeolus-restart-services
Expand Down

0 comments on commit 8e85f17

Please sign in to comment.