Add default graphs sequence

Create default sequence to run as a default.

Change-Id: Iecd3a88a2cbd92a33b55e1f28e4987aef27a711f
Closes-Bug: #1668550
This commit is contained in:
Vladimir Kuklin 2017-02-22 17:17:51 +03:00 committed by Stanislaw Bogatkin
parent be656d6a26
commit 535d8fdbef
9 changed files with 140 additions and 39 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

@ -63,7 +63,9 @@ Fuel::Systemd {
service_manage => false,
}
fuel::systemd { ['httpd', 'cobblerd', 'dnsmasq', 'xinetd'] :}
fuel::systemd { ['httpd', 'cobblerd', 'xinetd'] :}
fuel::systemd { 'dnsmasq': template_path => 'fuel/systemd/dnsmasq_template.erb' }
fuel::dnsmasq::dhcp_range {'default':
dhcp_start_address => $admin_network['dhcp_pool_start'],

View File

@ -0,0 +1,35 @@
#!/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 default
rc=$?
if [[ $rc -eq 1 ]];
then
echo "Problem with sequence creation for release with id ${i} - command exited with ${rc} code"
exit 1
fi
else
fuel2 sequence update -r$i -n deploy-changes -t net-verification deletion provision default
rc=$?
if [[ $rc -eq 1 ]];
then
echo "Problem with sequence update for release with id ${i} - command exited with ${rc} code"
exit 1
fi
fi
done

View File

@ -0,0 +1,5 @@
[Service]
Restart=on-failure
RestartSec=5
StartLimitIntervalSec=10
StartLimitBurst=100

View File

@ -17,3 +17,4 @@ fi
test -z ${node_name} && echo 'Node name not found' && exit 1
cobbler system edit --name=${node_name} --netboot-enabled=${flag}
cobbler sync

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,59 +52,84 @@
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
type: puppet
version: 2.1.0
groups: [primary-controller, controller, cinder, cinder-block-device,
cinder-vmware, compute, compute-vmware, ceph-osd, primary-mongo, mongo, virt, ironic]
required_for: [v_setup_repositories]
groups: ['/.*/']
required_for: [v_mangle_ovs]
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/hiera/hiera.pp
puppet_modules: /etc/puppet/modules
timeout: 120
- id: v_setup_repositories
type: puppet
version: 2.1.0
groups: ['/.*/']
required_for: [v_fuel_pkgs]
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/fuel_pkgs/setup_repositories.pp
puppet_modules: /etc/puppet/modules
timeout: 600
- id: v_fuel_pkgs
type: puppet
version: 2.1.0
groups: [primary-controller, controller, cinder, cinder-block-device, cinder-vmware, compute, ceph-osd, primary-mongo, mongo, ironic]
required_for: [v_mangle_ovs]
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/fuel_pkgs/fuel_pkgs.pp
puppet_modules: /etc/puppet/modules
timeout: 600
- id: v_mangle_ovs
type: puppet
version: 2.1.0
groups: [primary-controller, controller, cinder, cinder-block-device, cinder-vmware, compute, ceph-osd, primary-mongo, mongo, ironic]
requires: [v_fuel_pkgs]
groups: ['/.*/']
requires: [v_hiera]
required_for: [v_netconfig]
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/netconfig/remove_ovs_usage.pp
@ -113,7 +138,7 @@
- id: v_netconfig
type: puppet
version: 2.1.0
groups: [primary-controller, controller, cinder, cinder-block-device, cinder-vmware, compute, ceph-osd, primary-mongo, mongo, virt, ironic]
groups: ['/.*/']
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/netconfig/netconfig.pp
puppet_modules: /etc/puppet/modules
@ -131,6 +156,7 @@
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/manifests/connectivity-checker.pp
puppet_modules: /etc/puppet/modules
timeout: 300
strategy:
type: parallel
timeout: 3600
strategy:
type: parallel
amount: 50

View File

@ -17,7 +17,8 @@
path: /tmp/provision.yaml
timeout: 180
data:
yaql_exp: "($.provision.set('packages', $.provision.packages.split('\n')) + $.repo_setup + dict('output' => '/var/www/nailgun/targetimages') + $).toYaml()"
#TODO: Replace dict($.items) to $ when LP1666913 is fixed
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 +92,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,18 @@ 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
if [ -L /etc/fuel/graphs/default ]
then
unlink /etc/fuel/graphs/default
elif [ -d /etc/fuel/graphs/default ]
then
mv /etc/fuel/graphs/default /etc/fuel/graphs/default.old
fi
ln -sf /etc/puppet/modules /etc/fuel/graphs/default
if [ "$1" = 2 ]; then
#Try to sync deployment tasks or notify user on upgrade
taskdir=/etc/puppet/%{openstack_version}/

View File

@ -39,7 +39,7 @@ describe manifest do
it { is_expected.to contain_file '/etc/resolv.conf' }
%w(httpd cobblerd dnsmasq xinetd).each do |service|
%w(httpd cobblerd xinetd).each do |service|
it "should containt '#{service}' fuel::systemd service with correct parameters" do
parameters = {
:start => true,
@ -50,6 +50,15 @@ describe manifest do
end
end
it "should containt dnsmasq fuel::systemd service with correct parameters" do
parameters = {
:start => true,
:template_path => 'fuel/systemd/dnsmasq_template.erb',
:config_name => 'restart.conf',
}
is_expected.to contain_fuel__systemd('dnsmasq').with parameters
end
it 'should declare the "fuel::dnsmasq::dhcp_range" with "default" title and correct parameters' do
parameters = {
:dhcp_start_address => fuel_settings['ADMIN_NETWORK']['dhcp_pool_start'],