prevent to execute unnecessary tasks when redeploy
Change-Id: I8c61f9a207016a8a867062fa250f5b89749d2add
This commit is contained in:
parent
02d05319ad
commit
15f3e8d522
|
@ -0,0 +1,27 @@
|
||||||
|
# Copyright 2016 Mirantis, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
notify {'MODULAR: fuel-plugin-manila/db-sync': }
|
||||||
|
|
||||||
|
$manila = hiera_hash('manila', {})
|
||||||
|
$db_pass = $manila['db_password']
|
||||||
|
$db_host = hiera('database_vip')
|
||||||
|
$req = 'select name from availability_zones\G'
|
||||||
|
|
||||||
|
exec { 'manual_db_sync':
|
||||||
|
command => 'manila-manage db sync',
|
||||||
|
path => '/usr/bin:/bin',
|
||||||
|
user => 'manila',
|
||||||
|
unless => "mysql -u manila -p${db_pass} -h ${db_host} -e \"${req}\" manila | grep nova"
|
||||||
|
}
|
|
@ -25,21 +25,19 @@ $inits = {
|
||||||
|
|
||||||
create_resources('::manila_auxiliary::initd', $inits)
|
create_resources('::manila_auxiliary::initd', $inits)
|
||||||
|
|
||||||
exec { 'manual_db_sync':
|
notify {'Restart manila-api':
|
||||||
command => 'manila-manage db sync',
|
}~>
|
||||||
path => '/usr/bin',
|
|
||||||
user => 'manila',
|
|
||||||
}->
|
|
||||||
|
|
||||||
service { 'manila-api':
|
service { 'manila-api':
|
||||||
ensure => 'running',
|
ensure => 'running',
|
||||||
name => 'manila-api',
|
name => 'manila-api',
|
||||||
enable => true,
|
enable => true,
|
||||||
hasstatus => true,
|
hasstatus => true,
|
||||||
}->
|
}->
|
||||||
service { 'manila-scheduler':
|
notify {' Restart manila-scheduler':
|
||||||
ensure => 'running',
|
}~>
|
||||||
name => 'manila-scheduler',
|
service { 'manila-scheduler':
|
||||||
enable => true,
|
ensure => 'running',
|
||||||
hasstatus => true,
|
name => 'manila-scheduler',
|
||||||
}
|
enable => true,
|
||||||
|
hasstatus => true,
|
||||||
|
}
|
||||||
|
|
|
@ -23,10 +23,11 @@ $inits = {
|
||||||
|
|
||||||
create_resources('::manila_auxiliary::initd', $inits)
|
create_resources('::manila_auxiliary::initd', $inits)
|
||||||
|
|
||||||
|
notify {'Restart manila-data':
|
||||||
service { 'manila-data':
|
}~>
|
||||||
ensure => 'running',
|
service { 'manila-data':
|
||||||
name => 'manila-data',
|
ensure => 'running',
|
||||||
enable => true,
|
name => 'manila-data',
|
||||||
hasstatus => true,
|
enable => true,
|
||||||
}
|
hasstatus => true,
|
||||||
|
}
|
||||||
|
|
|
@ -61,10 +61,11 @@ $inits = {
|
||||||
|
|
||||||
create_resources('::manila_auxiliary::initd', $inits)
|
create_resources('::manila_auxiliary::initd', $inits)
|
||||||
|
|
||||||
|
notify {'Restart manila-share':
|
||||||
service { 'manila-share':
|
}~>
|
||||||
ensure => 'running',
|
service { 'manila-share':
|
||||||
name => 'manila-share',
|
ensure => 'running',
|
||||||
enable => true,
|
name => 'manila-share',
|
||||||
hasstatus => true,
|
enable => true,
|
||||||
}
|
hasstatus => true,
|
||||||
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
- id: manila-share
|
- id: manila-share
|
||||||
type: group
|
type: group
|
||||||
role: [manila-share]
|
role: [manila-share]
|
||||||
tasks: [hiera, globals, setup_repositories, tools, logging, netconfig, firewall, hosts, ntp-client, dns-client, cgroups, deploy_start]
|
tasks: [hiera, globals, setup_repositories, tools, logging, netconfig, firewall, hosts, ntp-client, dns-client, cgroups, manila-hiera, deploy_start]
|
||||||
required_for: [deploy_end]
|
required_for: [deploy_end]
|
||||||
requires: [deploy_start, primary-controller]
|
requires: [deploy_start, primary-controller]
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
- id: manila-data
|
- id: manila-data
|
||||||
type: group
|
type: group
|
||||||
role: [manila-data]
|
role: [manila-data]
|
||||||
tasks: [hiera, globals, setup_repositories, tools, logging, netconfig, firewall, hosts, ntp-client, dns-client, cgroups, deploy_start]
|
tasks: [hiera, globals, setup_repositories, tools, logging, netconfig, firewall, hosts, ntp-client, dns-client, cgroups, manila-hiera, deploy_start]
|
||||||
required_for: [deploy_end]
|
required_for: [deploy_end]
|
||||||
requires: [deploy_start, primary-controller]
|
requires: [deploy_start, primary-controller]
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
requires: [pre_deployment_start]
|
requires: [pre_deployment_start]
|
||||||
required_for: [manila-copy_keys]
|
required_for: [manila-copy_keys]
|
||||||
parameters:
|
parameters:
|
||||||
cmd: sh /etc/puppet/modules/osnailyfacter/modular/astute/generate_keys.sh -p /var/lib/fuel/keys/ -i {CLUSTER_ID} -s 'manila'
|
cmd: sh /var/www/nailgun/plugins/fuel-plugin-manila-1.0/gen_keys.sh {CLUSTER_ID}
|
||||||
timeout: 180
|
timeout: 180
|
||||||
|
|
||||||
- id: manila-copy_keys
|
- id: manila-copy_keys
|
||||||
|
@ -200,11 +200,24 @@
|
||||||
puppet_modules: "puppet/modules:/etc/puppet/modules"
|
puppet_modules: "puppet/modules:/etc/puppet/modules"
|
||||||
timeout: 3600
|
timeout: 3600
|
||||||
|
|
||||||
|
- id: manila-db-sync
|
||||||
|
type: puppet
|
||||||
|
groups: [primary-controller]
|
||||||
|
version: 2.1.0
|
||||||
|
requires: [manila-main, manila-db]
|
||||||
|
required_for: [manila-controller-start]
|
||||||
|
parameters:
|
||||||
|
puppet_manifest: "puppet/manifests/db-sync.pp"
|
||||||
|
puppet_modules: "puppet/modules:/etc/puppet/modules"
|
||||||
|
timeout: 3600
|
||||||
|
|
||||||
- id: manila-controller-start
|
- id: manila-controller-start
|
||||||
type: puppet
|
type: puppet
|
||||||
groups: [primary-controller, controller]
|
groups: [primary-controller, controller]
|
||||||
version: 2.1.0
|
version: 2.1.0
|
||||||
requires: [manila-main]
|
requires: [manila-main]
|
||||||
|
cross-depends:
|
||||||
|
- name: manila-db-sync
|
||||||
parameters:
|
parameters:
|
||||||
puppet_manifest: "puppet/manifests/start_controller.pp"
|
puppet_manifest: "puppet/manifests/start_controller.pp"
|
||||||
puppet_modules: "puppet/modules:/etc/puppet/modules"
|
puppet_modules: "puppet/modules:/etc/puppet/modules"
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CLUSTER_ID=$1
|
||||||
|
|
||||||
|
if [ ! -d /var/lib/fuel/keys/$CLUSTER_ID/manila ]; then
|
||||||
|
sh /etc/puppet/modules/osnailyfacter/modular/astute/generate_keys.sh -p /var/lib/fuel/keys/ -i $CLUSTER_ID -s 'manila'
|
||||||
|
fi
|
|
@ -1,15 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
CLUSTER_ID=$1
|
CLUSTER_ID=$1
|
||||||
|
PLUGIN_YAML=/etc/fuel/cluster/$CLUSTER_ID/fuel-plugin-manila.yaml
|
||||||
|
|
||||||
gen_pass() {
|
if [ ! -f $PLUGIN_YAML ]; then
|
||||||
openssl rand -base64 32|tr -d '='
|
|
||||||
}
|
|
||||||
|
|
||||||
user_pass=$(gen_pass)
|
gen_pass() {
|
||||||
maniladb_pass=$(gen_pass)
|
openssl rand -base64 32|tr -d '='
|
||||||
|
}
|
||||||
|
|
||||||
echo "
|
user_pass=$(gen_pass)
|
||||||
|
maniladb_pass=$(gen_pass)
|
||||||
|
|
||||||
|
echo "
|
||||||
---
|
---
|
||||||
manila:
|
manila:
|
||||||
user_password: $user_pass
|
user_password: $user_pass
|
||||||
|
@ -23,4 +26,5 @@ echo "
|
||||||
min_ram: \"256\"
|
min_ram: \"256\"
|
||||||
os_name: ubuntu
|
os_name: ubuntu
|
||||||
public: \"true\"
|
public: \"true\"
|
||||||
" > /etc/fuel/cluster/$CLUSTER_ID/fuel-plugin-manila.yaml
|
" > $PLUGIN_YAML
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue