Commit 6b97d3d0 authored by Alexandre MERLIN's avatar Alexandre MERLIN
Browse files

Merge branch 'feat/label' into 'master'

Feat/label

See merge request !20
parents 228321db 52efaff2
Pipeline #273815 waiting for manual action with stages
in 17 minutes and 15 seconds
......@@ -38,6 +38,7 @@ class KadeployClient < ClientWorkflow
:force => false,
:disable_kexec => nil,
:dont_trust_env => nil,
:always_trust_env => nil,
:disable_bootloader_install => nil,
:disable_disk_partitioning => nil,
:reboot_classical_timeout => nil,
......@@ -73,12 +74,15 @@ class KadeployClient < ClientWorkflow
parse_env_version(opt,options)
opt.separator ""
opt.separator "Advanced options:"
add_opt(opt,"--no-kexec", "Disable kexec reboots during the deployment process") {
add_opt(opt,"--no-kexec", "Disable kexec from the deployment kernel to the deployed environment") {
options[:disable_kexec] = true
}
add_opt(opt,"--never-trust-environment", "Disable kexec to the deployment kernel when environment is trusted") {
add_opt(opt,"--force-untrust-current-env", "Never trust the current environment. It will disable kexec to the deployment kernel") {
options[:dont_trust_env] = true
}
add_opt(opt,"--force-trust-current-env", "Always trust the current environment. Kadeploy will try to use kexec to the deployment kernel regardless of the current environment") {
options[:always_trust_env] = true
}
add_opt(opt,"--disable-bootloader-install", "Disable the automatic installation of a bootloader for a Linux based environment") {
options[:disable_bootloader_install] = true
}
......@@ -117,6 +121,9 @@ class KadeployClient < ClientWorkflow
error('You must define a PXE boot profile if you want to push some files in the PXE repository')
end
if options[:always_trust_env] && options[:dont_trust_env]
error('You cannot use "--force-untrust-current-env" and "--force-trust-current-env" at the same time')
end
true
end
......@@ -135,6 +142,7 @@ class KadeployClient < ClientWorkflow
params[:timeout_reboot_kexec] = options[:reboot_kexec_timeout] if options[:reboot_kexec_timeout]
params[:disable_kexec] = options[:disable_kexec] if options[:disable_kexec]
params[:dont_trust_env] = options[:dont_trust_env] if options[:dont_trust_env]
params[:always_trust_env] = options[:always_trust_env] if options[:always_trust_env]
params[:disable_bootloader_install] = options[:disable_bootloader_install] if options[:disable_bootloader_install]
params[:disable_disk_partitioning] = options[:disable_disk_partitioning] if options[:disable_disk_partitioning]
if options[:pxe_profile]
......
......@@ -55,21 +55,15 @@ class KaenvsClient < Client
debug sprintf(format,env['name'],env['version'],env['user'],env['description'])
end
def print_full(env)
def print_full(env, type=:yaml)
env.delete('user')
debug env.to_yaml
#YAML::quick_emit(env) do |out|
# out.map(env.taguri(), env.to_yaml_style()) do |map|
# env.keys.sort do |x,y|
# tmpx = YAML_SORT.index(x)
# tmpy = YAML_SORT.index(y)
# tmpx,tmpy = [x.to_s,y.to_s] if !tmpx and !tmpy
# (tmpx || max+1) <=> (tmpy || max+2)
# end.each{ |k| map.add(k, env[k]) }
# #content_hash.sort_by { |k,v| k }.each{ |t| map.add(t[0],t[1]) }
# #content_hash.keys.sort.each { |k| map.add(k, content_hash[k]) }
# end
#end
if type == :yaml
debug env.to_yaml
elsif type == :json
debug env.to_json
else
error("Invalid type (#{type})")
end
end
def self.operation()
......@@ -89,6 +83,7 @@ class KaenvsClient < Client
:visibility_tag => nil,
:files_to_move => {},
:secure => false,
:type => :yaml,
}
)
end
......@@ -156,6 +151,9 @@ class KaenvsClient < Client
add_opt(opt,"--move-files", "Move the files of the environments (for administrators only)") {
options[:operation] = :'move-files'
}
add_opt(opt,"--json", "print the env info as json (only available with when printing an environment)") {
options[:type] = :'json'
}
parse_secure(opt,options)
end
end
......@@ -330,7 +328,7 @@ class KaenvsClient < Client
list = ret
end
list.each do |env|
print_full(env)
print_full(env, options[:type])
end
end
when :'move-files'
......
......@@ -22,6 +22,7 @@ class KanodesClient < Client
:operation => nil,
:user => nil,
:wid => nil,
:type => :yaml,
}
)
end
......@@ -52,6 +53,9 @@ class KanodesClient < Client
add_opt(opt,"-w", "--workflow-id WID", "Specify a workflow id (to be used with the get_status option). If no wid is specified, the information of all the running deployments will be returned.") { |w|
options[:wid] = w
}
add_opt(opt, "--json", "use json output instead of yaml") {
options[:type] = :json
}
end
end
......@@ -109,9 +113,15 @@ class KanodesClient < Client
path.each do |p|
ret += get(p,params)
end
ret.to_yaml
if options[:type] == :yaml
ret.to_yaml
elsif options[:type] == :json
ret.to_json
else
raise
end
else
get(path,params,:yaml,false)
get(path,params,options[:type],options[:type] == :json)
end
end
......
......@@ -85,7 +85,7 @@ BINARIES = ['kastat3', 'kapower3', 'kaenv3', 'kaconsole3', 'kareboot3', 'kanodes
BINARIES.each do |b|
PATTERNS["/usr/share/man/man1/#{b}.1.gz"] = "/usr/share/man/man1/#{b}-#{suffix}.1.gz"
PATTERNS["/usr/share/man/man8/#{b}.8.gz"] = "/usr/share/man/man8/#{b}-#{suffix}.8.gz"
PATTERNS["/usr/bin/#{b}"] = "/usr/bin/#{b}-#{suffix}"
PATTERNS["/usr/bin/#{b}"] = "/usr/sbin/#{b}-#{suffix}"
PATTERNS["/usr/sbin/#{b}"] = "/usr/sbin/#{b}-#{suffix}"
end
pkgs.map { |pkg| "#{pkg}-#{suffix}"}.each do |pkg|
......
No preview for this file type
......@@ -601,6 +601,7 @@ environments:
extraction_dir: /mnt/dest
tarball_dir: /tmp
rambin_dir: /rambin
allowed_name_regex: '[A-Za-z0-9\-\_]+'
max_postinstall_size: 10
max_preinstall_size: 10
pxe:
......@@ -768,6 +769,7 @@ external:
\item \ypath{/environments}
\begin{itemize}
\item \yfieldd{allowed\_name\_regex}{String} A regex that control how an environement should be name.
\item \yfieldd{max\_preinstall\_size}{Integer}{20} maximum size (MB) of the preinstall files
\item \yfieldd{max\_postinstall\_size}{Integer}{20} maximum size (MB) of the postinstall files
\end{itemize}
......@@ -981,13 +983,12 @@ To define the specific configuration of a cluster, you must create a specific fi
\begin{verbatim}
---
partitioning:
block_device: /dev/sda
partitions:
swap: 1
prod: 2
deploy: 3
tmp: 5
script: parted_sample
formating_script: formating.sh
deploy_label: DEPLOY
block_device: disk0
disk_path:
disk0: /dev/disk/by-path/pci-0000:00:0d.0-ata-1
trusted_deployment:
user: deploy
partition: "/dev/sda3"
......@@ -1133,17 +1134,12 @@ automata:
\begin{itemize}
\item \ypath{/partitioning}
\begin{itemize}
\item \yfield{block\_device}{String}block device of the disk used on the nodes
\item \yfield{block\_device}{String}default disk used on the nodes
\item \yfield{deploy\_label}{String}default label used on the nodes
\item \yfieldd{disable\_swap}{Boolean}{false} disable the swap partition on the disk
\item \yfield{script}{String} Path to a script that creates the partition table on the nodes. You can use Kadeploy3 environment variables (see section \ref{sec:env_vars}) in this script. Please refer to section \ref{sec:partscript}) for further informations.
\end{itemize}
\item \ypath{/partitioning/partitions}
\begin{itemize}
\item \yfieldd{swap}{Integer}{1} number of the swap partition on the disk
\item \yfieldd{prod}{Integer}{-1} number of the production partition on the disk
\item \yfieldd{deploy}{Integer}{2} number of the deployment partition on the disk
\item \yfieldd{tmp}{Integer}{-1} number of the tmp partition on the disk
\item \yfield{formating\_script}{String} Path to a script that is used to format the partitions. You can use Kadeploy3 environment variables (see section \ref{sec:env_vars}) in this script. Please refer to section \ref{sec:formatscript}) for further informations.
\item \yfield{disk\_path}{Hash} Map the disks name to the real path on the nodes.
\end{itemize}
\item \ypath{/trusted\_deployment}
......@@ -1367,6 +1363,8 @@ Here is the list of the macro-step and their implementation:
\item format\_tmp\_part \texttt{[only if non-multipart]}
\item format\_swap\_part \texttt{[only if non-multipart]}
\end{itemize}
\item \texttt{SetDeploymentTrusted} \\
Check if the environement is trusted based on the cluster configuration if so, use \texttt{SetDeploymentEnvKexec} else use \texttt{SetDeploymentEnvUntrusted}.
\item \texttt{SetDeploymentEnvUntrustedCustomPreInstall}
\begin{itemize}
\item switch\_pxe
......@@ -1509,12 +1507,19 @@ A partitioning script must be provided for each cluster.
You can use the Kadeploy3 environment variables in your script (see section \ref{sec:env_vars}). The tools you can use in your script are the ones that are installed in your deployment environment (see section \ref{sec:deployenv}).
Be careful to write the partition type on MSDOS partitions, some bootloaders will fail to boot unless this information is written in the partition table.
The script must write GPT label on each partition use by Kadeploy3. The label must be prefixed by \texttt{KDPL\_} and end by the disk name (which is given by the \texttt{KADEPLOY\_DISK\_NAME} environment variable).
For exemple, \texttt{KDPL\_SWAP\_disk0} is a valid label.
The \texttt{SWAP} and \texttt{TMP} label are used to identify the swap and tmp partition. The default deploy partition is specify in the cluster configuration of Kadeploy3.
You should also use the \emph{/sbin/partprobe} at the end of your script to inform the OS (deployment environment) of partition table changes.
Examples of scripts are provided in the distribution (in the directory \texttt{scripts/partitioning/}).
\section{Formating script}\label{sec:formatscript}
A formating script can be provided for each cluster. You can use the Kadeploy3 environment variables in your script (see section \ref{sec:env_vars}).
The same script is used for all the formating operations (swap, tmp and deploy partitions). The \texttt{KADEPLOY\_FORMAT\_PART} environment variable allow you to distinguish each operation.
\section{Specific commands configuration files}
In the part~\ref{sec:specific_config} we saw that generic commands can be given to all the nodes that belong to a cluster. It is also possible to override these generic values for some specific nodes. To do this, you must fill the file named \texttt{command.conf} in the configuration directory.
......@@ -2313,12 +2318,11 @@ When writing a script for an admin pre-install, an admin/user post-install or so
\item \texttt{KADEPLOY\_ENV\_KERNEL\_PARAMS} : the deployed environment kernel parameters
\item \texttt{KADEPLOY\_ENV\_HYPERVISOR} : the path to the hypervisor's kernel file inside the deployed environment directory (usefull when deploying a Xen environment for example)
\item \texttt{KADEPLOY\_ENV\_HYPERVISOR\_PARAMS} : the deployed environment hypervisor parameters
\item \texttt{KADEPLOY\_DEPLOY\_PART} : deployment partition
\item \texttt{KADEPLOY\_BLOCK\_DEVICE} : the block device used in deployment
\item \texttt{KADEPLOY\_DEPLOY\_PART\_NUM} : the deployment parition number
\item \texttt{KADEPLOY\_SWAP\_PART\_NUM} : the swap partition number
\item \texttt{KADEPLOY\_PROD\_PART\_NUM} : the production partition number
\item \texttt{KADEPLOY\_TMP\_PART\_NUM} : the tmp partition number
\item \texttt{KADEPLOY\_DEPLOY\_PART} : path to the deployment partition
\item \texttt{KADEPLOY\_TMP\_PART} : path to the tmp partition
\item \texttt{KADEPLOY\_SWAP\_PART} : path to the swap partition
\item \texttt{KADEPLOY\_DISK\_NAME} : the Kadeploy3 name of the disk used in deployment
\item \texttt{KADEPLOY\_BLOCK\_DEVICE} : the path to the block device used in deployment
\item \texttt{KADEPLOY\_ENV\_EXTRACTION\_DIR} : path where the environment tarball is extracted
\item \texttt{KADEPLOY\_PREPOST\_EXTRACTION\_DIR} : path where the pre/post tarball are extracted
\item \texttt{KADEPLOY\_TMP\_DIR} : a temporary directory (to be used for your scripts)
......@@ -2327,6 +2331,7 @@ When writing a script for an admin pre-install, an admin/user post-install or so
\item \texttt{KADEPLOY\_FS\_TYPE} : the filesystem format of the deployment partition (the value of the \emph{filesystem} field of the environment description)
\item \texttt{KADEPLOY\_FS\_TYPE\_TMP} : the filesystem format of the tmp partition (if the tmp partition is reformated with the option --reformat-tmp)
\item \texttt{KADEPLOY\_KEXEC\_KIND} : used for kexec script. Specify what kind of kexec is happening. value are \emph{to\_deployed\_env} or \emph{to\_deploy\_kernel}
\item \texttt{KADEPLOY\_FORMAT\_PART} : used for formating script. Specify what disk is being formated. value are \emph{DEPLOY},\emph{TMP} or \emph{SWAP}
\item \texttt{KADEPLOY\_DEPLOY\_ENV\_KERNEL\_PARAMS} : the deployment kernel kernel parameters
\item \texttt{KADEPLOY\_ENV\_KEXEC\_REPOSITORY} : the location where deploy kernel are copied for kexec purpose
\end{itemize}
......
......@@ -26,7 +26,7 @@ require 'io/console' if RUBY_VERSION >= '1.9'
module Kadeploy
CONTACT_EMAIL = "kadeploy3-users@lists.gforge.inria.fr"
CONTACT_EMAIL = "kadeploy-users@inria.fr"
USER = ENV['USER'] || ENV['USERNAME'] || Etc.getlogin || `id -nu`
STATUS_UPDATE_DELAY = 1
SLEEP_PITCH = 1
......@@ -1041,7 +1041,7 @@ class ClientWorkflow < Client
end
def self.parse_deploy_part(opt,options)
add_opt(opt,"-p", "--partition-number NUMBER", /^\d*$/, "Specify the partition number to use") { |p|
add_opt(opt,"-p", "--partition-number LABEL", "--partition-label LABEL", "Specify the partition label to use") { |p|
options[:deploy_part] = p
}
end
......
......@@ -282,7 +282,7 @@ class Environment
cp.parse('options',@multipart) do |info|
unless info[:empty]
@options['partitions'] = []
cp.parse('partitions',true,Array) do |info2|
cp.parse('partitions',@multipart,Array) do |info2|
unless info2[:empty]
tmp = {
'id' => cp.value('id', Integer),
......@@ -318,6 +318,8 @@ class Environment
"on the deployment partition"
)
end
@options['kexec'] = cp.value('kexec',[TrueClass,FalseClass],true)
@options['trust_env'] = cp.value('trust_previous_env', [TrueClass,FalseClass,nil],nil)
end
end
......@@ -329,7 +331,7 @@ class Environment
@hypervisor_params = cp.value('hypervisor_params',String,'')
if @multipart
@options['block_device'] = cp.value('block_device',String)
@options['deploy_part'] = cp.value('partition',Integer).to_s
@options['deploy_part'] = cp.value('partition',String)
end
end
......@@ -751,15 +753,14 @@ class Environment
tmp = {}
tmp['kernel'] = @kernel if !@kernel.nil? and !@kernel.empty?
tmp['initrd'] = @initrd if !@initrd.nil? and !@initrd.empty?
tmp['kernel_params'] = @kernel_params \
if !@kernel_params.nil? and !@kernel_params.empty?
tmp['kernel_params'] = @kernel_params
tmp['hypervisor'] = @hypervisor \
if !@hypervisor.nil? and !@hypervisor.empty?
tmp['hypervisor_params'] = @hypervisor_params \
if !@hypervisor_params.nil? and !@hypervisor_params.empty?
tmp['block_device'] = @options['block_device'] \
if !@options['block_device'].nil? and !@options['block_device'].empty?
tmp['partition'] = @options['deploy_part'].to_i \
tmp['partition'] = @options['deploy_part'] \
if !@options['deploy_part'].nil? and !@options['deploy_part'].empty?
ret['boot'] = tmp unless tmp.empty?
......
......@@ -393,7 +393,7 @@ module Automata
end
def done?()
@nodes.empty? or @nodes_done.equal?(@nodes)
@nodes.nil? || @nodes.empty? || @nodes_done.equal?(@nodes)
end
def clean_threads # To be called with the threads lock
......
......@@ -195,6 +195,7 @@ module Configuration
attr_reader :kadeploy_tcp_buffer_size
attr_reader :max_preinstall_size
attr_reader :max_postinstall_size
attr_reader :env_name_regex
attr_reader :ssh_port
attr_reader :test_deploy_env_port
attr_reader :environment_extraction_dir
......@@ -214,6 +215,7 @@ module Configuration
attr_reader :end_of_reboot_hook
attr_reader :end_of_power_hook
attr_reader :vlan_hostname_suffix
attr_reader :allow_vlan_failure
attr_reader :set_vlan_cmd
attr_reader :kastafior
attr_reader :kascade
......@@ -277,6 +279,7 @@ module Configuration
cp.parse('network',false) do
cp.parse('vlan') do
@vlan_hostname_suffix = cp.value('hostname_suffix',String,'')
@allow_vlan_failure = cp.value('allow_failure',[TrueClass, FalseClass],true)
@set_vlan_cmd = cp.value('set_cmd',String,'',{
:type => 'file', :command => true,
:readable => true, :executable => true
......@@ -554,6 +557,7 @@ module Configuration
cp.value('max_preinstall_size', Integer,20) *1024 * 1024
@max_postinstall_size =
cp.value('max_postinstall_size', Integer,20) * 1024 * 1024
@env_name_regex = cp.value('allowed_name_regex', String, nil)
end
cp.parse('pxe',true) do
......@@ -826,10 +830,11 @@ module Configuration
attr_reader :deploy_supported_fs
attr_reader :kexec_repository
attr_reader :block_device
attr_reader :deploy_part
attr_reader :prod_part
attr_reader :disk_path
attr_reader :swap_disabled
attr_reader :tmp_part
attr_reader :swap_part
attr_reader :deploy_part
attr_reader :workflow_steps #Array of MacroStep
attr_reader :timeout_reboot_classical
attr_reader :timeout_reboot_kexec
......@@ -973,18 +978,16 @@ module Configuration
cp.parse('partitioning',true) do
@block_device = cp.value('block_device',String,nil,Pathname)
@tmp_part = cp.value('tmp_label',String,'TMP')
@swap_part = cp.value('swap_label',String,'SWAP')
@deploy_part = cp.value('deploy_label',String,'DEPLOY')
@swap_part = cp.value('disable_swap',[TrueClass,FalseClass],false)? 'none':nil
cp.parse('partitions',true) do
@swap_part = cp.value('swap', Integer,nil).to_s unless @swap_part
@prod_part = cp.value('prod', Integer,-1).to_s
@deploy_part = cp.value('deploy', Integer).to_s
@tmp_part = cp.value('tmp', Integer,-1).to_s
end
@swap_disabled = cp.value('disable_swap',[TrueClass,FalseClass],false)
@partitioning_script = cp.value('script',String,nil,
{ :type => 'file', :readable => true, :prefix => Config.dir() })
@formating_script = cp.value('formating_script',String,'',
{ :type => 'file', :readable => true, :prefix => Config.dir() })
@disk_path = cp.value('disk_path',Hash,{})
end
cp.parse('kexec', true) do
......@@ -1252,7 +1255,7 @@ module Configuration
tmptime = eval(code)
@workflow_steps[0].to_a.each do |macroinst|
if macroinst[0] == 'SetDeploymentEnvKexec' and tmptime > macroinst[2]
if ['SetDeploymentEnvKexec','SetDeploymentEnvTrusted'].include?(macroinst[0]) && tmptime > macroinst[2]
then
raise ArgumentError.new(Parser.errmsg(
info[:path],"Global kexec timeout is greater than the timeout of the macrostep #{macroinst[0]}"
......@@ -1261,7 +1264,7 @@ module Configuration
end
end
@workflow_steps[2].to_a.each do |macroinst|
if macroinst[0] == 'BootNewEnvKexec' and tmptime > macroinst[2]
if macroinst[0] == 'BootNewEnvKexec' && tmptime > macroinst[2]
then
raise ArgumentError.new(Parser.errmsg(
info[:path],"Global kexec timeout is greater than the timeout of the macrostep #{macroinst[0]}"
......
......@@ -10,6 +10,7 @@ module Kadeploy
ret.disable_bootloader_install = false
ret.disable_disk_partitioning = false
ret.dont_trust_env = false
ret.always_trust_env = false
ret.timeout_reboot_kexec = nil
ret
end
......@@ -53,7 +54,7 @@ module Kadeploy
part = (
p.parse('block_device',String,
:default=>context.config.clusters[cluster].block_device) \
+ p.parse('deploy_partition',String,:emptiable=>true,
+ '/' + p.parse('deploy_partition',String,:emptiable=>true,
:default=>context.config.clusters[cluster].deploy_part)
)
kaerror(APIError::INVALID_RIGHTS,"deployment on partition #{part}") \
......@@ -68,6 +69,7 @@ module Kadeploy
context.disable_disk_partitioning = p.parse('disable_disk_partitioning',nil,:toggle=>true)
context.disable_kexec = p.parse('disable_kexec',nil,:toggle=>true)
context.dont_trust_env = p.parse('dont_trust_env',nil,:toggle=>true)
context.always_trust_env = p.parse('always_trust_env',nil,:toggle=>true)
# Check rights on multipart environement
if context.environment.multipart
......
......@@ -23,12 +23,16 @@ module Kaenvs
case operation
when :create
context.config = duplicate_config()
parse_params(params) do |p|
# Check client
context.client = p.parse('client',String,:type=>:client)
# Check Environment
env = p.parse('environment',Hash,:mandatory=>true)
if context.config.common.env_name_regex && !env['name'].match?(/\A#{context.config.common.env_name_regex}\Z/)
kaerror(APIError::INVALID_ENVIRONMENT, "Invalid environment name \"#{env['name']}\", should match regex \"#{context.config.common.env_name_regex}\"")
end
context.environment = Environment.new
# Check user
......
......@@ -37,7 +37,7 @@ module Kanodes
nodes.each{|n| error_not_found!(n) unless server_nodes.include?(n)} if nodes
nodes || server_nodes
else
ret = Nodes::get_states(cexec.database,nodes)
ret = Nodes::get_states(cexec.database,nodes || server_nodes)
error_not_found!(node) if nodes and (!ret or ret.empty?)
# Check that every nodes has a state, init to nil if not
......
......@@ -140,6 +140,10 @@ module Kaworkflow
kaerror(APIError::INVALID_RIGHTS) \
unless context.rights.granted?(context.user,context.nodes,'')
# Check rights for custom operation on the cluster
kaerror(APIError::INVALID_RIGHTS, "Custom operations only allowed if you have the rights on all the partiions of the nodes") \
unless context.rights.granted?(context.user,context.nodes,'*') || params["custom_operations"].nil?
# Check custom breakpoint
context.breakpoint = p.parse('breakpoint',String,:type=>:breakpoint,:kind=>kind)
......
......@@ -121,12 +121,14 @@ module Macrostep
@tasks = new_tasks
end
def delete_task(taskname)
def delete_task(taskname, reason=nil)
to_delete = []
delete = lambda do |arr,index|
if arr[index][0] == taskname
to_delete << [arr,index]
debug(5, " * Bypassing the step #{macroname}-#{taskname}",nsid)
message = " * Bypassing the step #{macroname}-#{taskname}"
message += " (#{reason})" unless reason.nil? || reason.empty?
debug(5, message,nsid)
end
end
......@@ -252,73 +254,77 @@ module Macrostep
# Deploy on block device
if cexec.block_device and !cexec.block_device.empty? \
and (!cexec.deploy_part or cexec.deploy_part.empty?)
delete_task(:create_partition_table)
delete_task(:format_deploy_part)
delete_task(:format_tmp_part)
delete_task(:format_swap_part)
delete_task(:create_partition_table, "deploy on block device")
delete_task(:format_deploy_part, "deploy on block device")
delete_task(:format_tmp_part, "deploy on block device")
delete_task(:format_swap_part, "deploy on block device")
end
delete_task(:decompress_environment) if !context[:cluster].decompress_environment and cexec.environment.image[:kind] != 'fsa'
if ['dd','fsa'].include?(cexec.environment.image[:kind])
delete_task(:format_deploy_part)
delete_task(:format_deploy_part, "environment image is #{cexec.environment.image[:kind]}")
# mount deploy part after send_environemnt
delete_task(:mount_deploy_part) if self.class.superclass == DeploySetDeploymentEnv
delete_task(:mount_deploy_partn, "mount deploy part after send_environemnt") if self.class.superclass == DeploySetDeploymentEnv
else
# mount deploy part after format_deploy_part
delete_task(:mount_deploy_part) if self.class.superclass == DeployBroadcastEnv
delete_task(:mount_deploy_part, "mount deploy part after format_deploy_part") if self.class.superclass == DeployBroadcastEnv
end
# The filesystem is not supported by the deployment kernel
unless context[:cluster].deploy_supported_fs.include?(cexec.environment.filesystem)
delete_task(:mount_deploy_part)
delete_task(:umount_deploy_part)
delete_task(:manage_admin_post_install)
delete_task(:manage_user_post_install)
delete_task(:check_kernel_files)
delete_task(:send_key)
delete_task(:install_bootloader)
delete_task(:mount_deploy_part, "filesystem not supported by deployment kernel")
delete_task(:umount_deploy_part, "filesystem not supported by deployment kernel")
delete_task(:manage_admin_post_install, "filesystem not supported by deployment kernel")
delete_task(:manage_user_post_install, "filesystem not supported by deployment kernel")
delete_task(:check_kernel_files, "filesystem not supported by deployment kernel")
delete_task(:send_key, "filesystem not supported by deployment kernel")
delete_task(:install_bootloader, "filesystem not supported by deployment kernel")
end
# Multi-partitioned environment
if cexec.environment.multipart
delete_task(:format_tmp_part)
delete_task(:format_swap_part)
delete_task(:format_tmp_part, "Multi-partitioned environment")
delete_task(:format_swap_part, "Multi-partitioned environment")
end
if !cexec.key or cexec.key.empty?
delete_task(:send_key_in_deploy_env)
delete_task(:send_key)
delete_task(:send_key_in_deploy_env, "no key to send")
delete_task(:send_key, "no key to send")
end
delete_task(:create_partition_table) if cexec.disable_disk_partitioning
delete_task(:create_partition_table, "disk partitioning disabled") if cexec.disable_disk_partitioning
delete_task(:format_tmp_part) unless cexec.reformat_tmp
delete_task(:format_swap_part) \
if context[:cluster].swap_part.nil? \
or context[:cluster].swap_part == 'none' \
or cexec.environment.environment_kind != 'linux'
if cexec.environment.environment_kind != 'linux'
delete_task(:format_swap_part, "environment is not linux")
elsif context[:cluster].swap_disabled
delete_task(:format_swap_part, "swap disabled in cluster configuration")
end
delete_task(:install_bootloader) \
if context[:common].pxe[:local].is_a?(NetBoot::GrubPXE) \
or cexec.disable_bootloader_install
if context[:common].pxe[:local].is_a?(NetBoot::GrubPXE)
delete_task(:install_bootloader, "GrubPXE Used")
elsif cexec.disable_bootloader_install
delete_task(:install_bootloader, "bootloader disabled")
end
delete_task(:manage_admin_pre_install) \
delete_task(:manage_admin_pre_install, "no admin preinstall") \
if cexec.environment.preinstall.nil? \
and context[:cluster].admin_pre_install.nil?
delete_task(:manage_admin_post_install) if context[:cluster].admin_post_install.nil?
delete_task(:manage_admin_post_install, "no admin postinstall") if context[:cluster].admin_post_install.nil?
delete_task(:manage_user_post_install) if cexec.environment.postinstall.nil?
delete_task(:manage_user_post_install, "no user postinstall") if cexec.environment.postinstall.nil?
delete_task(:set_vlan) if cexec.vlan_id.nil?
delete_task(:set_default_vlan, "no vlan cmd set") if cexec.vlan_id.nil? && context[:common].set_vlan_cmd.nil?
delete_task(:set_vlan, "no vlan set") if cexec.vlan_id.nil?