Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #40 from mbacchi/mido-ordering
Browse files Browse the repository at this point in the history
Issue #32 move mn-conf to calyptos bootstrap phase
  • Loading branch information
mbacchi authored Jun 9, 2016
2 parents 6a1ee44 + 193cb71 commit 1747a2d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
15 changes: 0 additions & 15 deletions recipes/create-first-resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@
not_if "#{midonet_command_prefix} -e help || sleep 20 && #{midonet_command_prefix} -e help"
end


### Sets Cassandra server config in Zookeeper
#### This overwrites the existing entries with whatever is in the cassandras attr
cassandra_host_list = node['midokura']['cassandras'].join(',')
Chef::Log.info("Setting Cassandra Servers: #{cassandra_host_list}")
bash "Configure Cassandra Servers" do
code <<-EOH
echo "Setting Cassandra Servers: #{cassandra_host_list}"
echo 'cassandra.servers : "#{cassandra_host_list}"' | mn-conf set -t default
EOH
retries 6
retry_delay 10
flags '-xe'
end

execute 'Create TunnelZone' do
command "#{midonet_command_prefix} -e add tunnel-zone name #{tunnel_zone_name} type gre"
retries 20
Expand Down
18 changes: 18 additions & 0 deletions recipes/midonet-api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
options node['midokura']['yum-options']
end

package "midolman" do
options node['midokura']['yum-options']
end

# HACK: the midonet-api package should include tomcat loader midonet-api.xml
file "/etc/tomcat/Catalina/localhost/midonet-api.xml" do
content "<Context path=\"/midonet-api\" docBase=\"/usr/share/midonet-api\" antiResourceLocking=\"false\" privileged=\"true\"/>"
Expand Down Expand Up @@ -75,3 +79,17 @@
service 'tomcat' do
action [:enable, :start]
end

### Sets Cassandra server config in Zookeeper
#### This overwrites the existing entries with whatever is in the cassandras attr
cassandra_host_list = node['midokura']['cassandras'].join(',')
Chef::Log.info("Setting Cassandra Servers: #{cassandra_host_list}")
bash "Configure Cassandra Servers" do
code <<-EOH
echo "Setting Cassandra Servers: #{cassandra_host_list}"
echo 'cassandra.servers : "#{cassandra_host_list}"' | mn-conf set -t default
EOH
retries 6
retry_delay 10
flags '-xe'
end
15 changes: 13 additions & 2 deletions recipes/nuke.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@
end

### Stop Cassandra service
service "cassandra" do
action [ :stop ]
if Chef::VersionConstraint.new("~> 6.0").include?(node['platform_version'])
service "cassandra" do
action [ :stop ]
only_if "ls /etc/rc.d/init.d/cassandra"
end
end
if Chef::VersionConstraint.new("~> 7.0").include?(node['platform_version'])
# stop cassandra service on el7 with service command, the current rpm (2.0.17-1)
# doesn't have a proper systemd unit file and therefore 'systemctl' fails
execute "Stop cassandra service with system V init" do
command "service cassandra stop"
only_if "ls /etc/rc.d/init.d/cassandra"
end
end

### Stop Midolman service
Expand Down

0 comments on commit 1747a2d

Please sign in to comment.