Fix idempotency for workaround puppet manifests

Change-Id: I9374d5bf1d38d7589dd6af317d4c78c5e203d121
This commit is contained in:
Samir Ibradžić 2016-04-06 18:26:10 +09:00
parent 3f9f561c88
commit 2afe291180
2 changed files with 8 additions and 2 deletions

View File

@ -36,11 +36,13 @@ if member($roles, 'primary-controller') {
} ->
exec {'stop-l3-agent':
command => 'crm resource stop p_neutron-l3-agent',
path => '/usr/bin:/usr/sbin'
path => '/usr/bin:/usr/sbin',
onlyif => 'crm resource status p_neutron-l3-agent'
} ->
exec {'delete-l3-agent':
command => 'crm configure delete p_neutron-l3-agent',
path => '/usr/bin:/usr/sbin'
path => '/usr/bin:/usr/sbin',
onlyif => 'crm resource status p_neutron-l3-agent'
}
} else {
service {$ovs_agent_name:

View File

@ -1,21 +1,25 @@
exec { 'drop_neutron_db':
command => "mysql -e 'drop database if exists neutron;'",
path => '/usr/bin',
unless => 'mysql neutron -e "SELECT * FROM alembic_version_midonet LIMIT 1;"'
}
exec { 'create_neutron_db':
command => "mysql -e 'create database neutron character set utf8;'",
path => '/usr/bin',
unless => 'mysql neutron -e "SELECT * FROM alembic_version_midonet LIMIT 1;"'
}
exec { 'grant_neutron_db':
command => "mysql -e \"grant all on neutron.* to 'neutron'@'%';\"",
path => '/usr/bin',
unless => 'mysql neutron -e "SELECT * FROM alembic_version_midonet LIMIT 1;"'
}
exec { 'neutron_db_sync':
command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head',
path => '/usr/bin',
unless => 'mysql neutron -e "SELECT * FROM alembic_version_midonet LIMIT 1;"'
timeout => 500,
}