Merge "Add default graphs sequence"

This commit is contained in:
Jenkins 2017-03-01 16:09:06 +00:00 committed by Gerrit Code Review
commit bfe4985d8d
5 changed files with 96 additions and 8 deletions

View File

@ -19,3 +19,11 @@ exec {'sync_deployment_tasks':
try_sleep => 10,
require => Class['fuel::nailgun::client']
}
exec {'upload_default_sequence':
command => '/etc/puppet/modules/fuel/files/upload-default-sequence.sh',
path => '/usr/bin',
tries => 2,
try_sleep => 10,
require => Exec['sync_deployment_tasks']
}

View File

@ -0,0 +1,27 @@
#!/bin/bash
for i in `fuel2 release list | grep -e Ubuntu | grep -v unavailable | awk '{ print $2 }'`; do
graph_types=`ls /etc/fuel/graphs/`
# TODO(sbog): currently we can't list graph types for a release, so we
# can't make this idempotent. As it will be fixed, let's implement
# idempotent behavior here.
for graph_type in ${graph_types}; do
fuel2 graph upload -r$i -t ${graph_type} -d /etc/fuel/graphs/${graph_type}/
rc=$?
if [[ $rc -eq 1 ]];
then
echo "Problem with graph ${graph_type} upload - command exited with ${rc} code"
exit 1
fi
done
existing_releases=`fuel2 sequence list -r$i | grep deploy-changes | awk '{ print $4 }'`
if ! [[ ${existing_releases[*]} =~ "$i" ]]
then
fuel2 sequence create -r$i -n deploy-changes -t net-verification deletion provision deploy
rc=$?
if [[ $rc -eq 1 ]];
then
echo "Problem with sequence creation for release with id ${i} - command exited with ${rc} code"
exit 1
fi
fi
done

View File

@ -44,7 +44,7 @@
timeout: 180
cwd: /
- id: v_upload_configuration
- id: v_upload_node_configuration
type: upload_file
version: 2.1.0
role: ['master', '/.*/']
@ -52,21 +52,67 @@
required_for: [v_hiera]
refresh_on: ['*']
parameters:
path: /etc/fuel/cluster/{CLUSTER_ID}/astute.yaml
path: /etc/fuel/cluster/{CLUSTER_ID}/node.yaml
permissions: '0640'
dir_permissions: '0750'
timeout: 180
data:
yaql_exp: '$.toYaml()'
yaql_exp: '$node.toYaml()'
- id: v_configuration_symlink
- id: v_upload_cluster_configuration
type: upload_file
version: 2.1.0
role: ['master']
condition:
yaql_exp: 'changed($)'
requires: []
required_for: [copy_cluster_configuration]
refresh_on: ['*']
parameters:
path: /var/lib/fuel/configs/{CLUSTER_ID}/cluster.yaml
permissions: '0640'
dir_permissions: '0750'
timeout: 180
data:
yaql_exp: '$common.toYaml()'
- id: v_copy_cluster_configuration
type: copy_files
version: 2.1.0
role: ['master', '/.*/']
condition:
yaql_exp: 'changed($)'
requires: [v_upload_cluster_configuration]
cross-depends:
- name: v_upload_cluster_configuration
role: master
parameters:
files:
- src: /var/lib/fuel/configs/{CLUSTER_ID}/cluster.yaml
dst: /etc/fuel/cluster/{CLUSTER_ID}/cluster.yaml
permissions: '0644'
dir_permissions: '0755'
- id: v_configuration_symlink_cluster
type: shell
version: 2.1.0
role: ['/.*/']
requires: [v_upload_configuration]
required_for: [v_hiera]
requires: [v_copy_cluster_configuration, v_hiera]
required_for: [v_mangle_ovs]
parameters:
cmd: ln -sf /etc/fuel/cluster/{CLUSTER_ID}/astute.yaml /etc/astute.yaml
cmd: ln -sf /etc/fuel/cluster/{CLUSTER_ID}/cluster.yaml /etc/hiera/cluster.yaml
timeout: 180
- id: v_configuration_symlink_node
type: shell
version: 2.1.0
role: ['/.*/']
condition:
yaql_exp: '$.uid in added($.nodes).uid'
requires: [v_upload_node_configuration, v_hiera]
required_for: [v_mangle_ovs]
parameters:
cmd: ln -sf /etc/fuel/cluster/{CLUSTER_ID}/node.yaml /etc/hiera/node.yaml
timeout: 180
- id: v_hiera

View File

@ -17,7 +17,7 @@
path: /tmp/provision.yaml
timeout: 180
data:
yaql_exp: "($.provision + $.repo_setup + dict('output' => '/var/www/nailgun/targetimages') + $common).toYaml()"
yaql_exp: "($.provision.set('packages', $.provision.packages) + $.repo_setup + dict('output' => '/var/www/nailgun/targetimages') + dict($.items())).toYaml()"
- id: generate_ironic_bootstrap_keys
type: shell
@ -91,6 +91,8 @@
requires: [system_provision]
required_for: [node_reboot]
parameters:
strategy:
type: one_by_one
cmd:
yaql_exp: 'concat("sh /etc/puppet/modules/osnailyfacter/modular/provision/netboot disable ", $.provision.name)'
timeout: 180

View File

@ -142,6 +142,11 @@ do
ln -s /etc/puppet/%{openstack_version}/${i} /etc/puppet/${i}
done
# Create symlink for deployment graph
# TODO(sbog): remove this when deployment graph will be splitted to separate
# subgraphs
ln -sf /etc/puppet/modules /etc/fuel/graphs/deploy
if [ "$1" = 2 ]; then
#Try to sync deployment tasks or notify user on upgrade
taskdir=/etc/puppet/%{openstack_version}/