class Bosh::Stemcell::StageCollection

Public Class Methods

new(definition) click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 9
def initialize(definition)
  @definition = definition
end

Public Instance Methods

agent_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 32
def agent_stages
  [
    :bosh_ruby,
    :bosh_go_agent,
    :bosh_micro_go,
    :aws_cli,
    :logrotate_config,
    :dev_tools_config,
  ]
end
build_stemcell_image_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 43
def build_stemcell_image_stages
  stages = case infrastructure
  when Infrastructure::Aws then
    aws_stages
  when Infrastructure::Google then
    google_stages
  when Infrastructure::OpenStack then
    openstack_stages
  when Infrastructure::Vsphere then
    vsphere_vcloud_stages
  when Infrastructure::Vcloud then
    vsphere_vcloud_stages
  when Infrastructure::Warden then
    warden_stages
  when Infrastructure::Azure then
    azure_stages
  when Infrastructure::Softlayer then
    softlayer_stages
  end

  stages.concat(finish_stemcell_stages)
end
extract_operating_system_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 26
def extract_operating_system_stages
  [
    :untar_base_os_image,
  ]
end
operating_system_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 13
def operating_system_stages
  case operating_system
    when OperatingSystem::Centos then
      centos_os_stages
    when OperatingSystem::Rhel then
      rhel_os_stages
    when OperatingSystem::Ubuntu then
      ubuntu_os_stages
    when OperatingSystem::Photonos then
      photonos_os_stages
  end
end
package_stemcell_stages(disk_format) click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 66
def package_stemcell_stages(disk_format)
  case disk_format
    when 'raw' then
      raw_package_stages
    when 'rawdisk' then
      rawdisk_package_stages
    when 'qcow2' then
      qcow2_package_stages
    when 'ovf' then
      ovf_package_stages
    when 'vhd' then
      vhd_package_stages
    when 'files' then
      files_package_stages
  end
end

Private Instance Methods

aws_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 127
def aws_stages
  [
    :system_network,
    :system_aws_modules,
    :system_parameters,
    :bosh_clean,
    :bosh_harden,
    :bosh_aws_agent_settings,
    :bosh_clean_ssh,
    :image_create,
    :image_install_grub,
    :image_aws_update_grub,
  ]
end
azure_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 170
def azure_stages
  [
    :system_azure_network,
    :system_azure_wala,
    :system_parameters,
    :enable_udf_module,
    :bosh_clean,
    :bosh_harden,
    :bosh_azure_agent_settings,
    :bosh_clean_ssh,
    :image_create,
    :image_install_grub,
  ]
end
bosh_steps() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 288
def bosh_steps
  [
    :bosh_sysctl,
    :bosh_limits,
    :bosh_users,
    :bosh_monit,
    :bosh_ntpdate,
    :bosh_sudoers,
  ].flatten
end
centos_os_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 208
def centos_os_stages
  [
    :base_centos,
    :base_runsvdir,
    :base_centos_packages,
    :base_file_permission,
    :base_ssh,
    :system_kernel_modules,
    :system_ixgbevf,
    bosh_steps,
    :password_policies,
    :tty_config,
    :rsyslog_config,
    :delay_monit_start,
    :system_grub,
    :cron_config,
    :escape_ctrl_alt_del,
    :bosh_audit,
    :bosh_log_audit_start,
  ].flatten
end
files_package_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 331
def files_package_stages
  [
    :prepare_files_image_stemcell,
  ]
end
finish_stemcell_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 202
def finish_stemcell_stages
  [
    :bosh_package_list
  ]
end
google_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 142
def google_stages
  [
    :system_network,
    :system_google_modules,
    :system_google_packages,
    :system_parameters,
    :bosh_clean,
    :bosh_harden,
    :bosh_google_agent_settings,
    :bosh_clean_ssh,
    :image_create,
    :image_install_grub,
  ]
end
is_centos?() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 337
def is_centos?
  operating_system.instance_of?(OperatingSystem::Centos)
end
is_rhel?() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 341
def is_rhel?
  operating_system.instance_of?(OperatingSystem::Rhel)
end
openstack_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 87
def openstack_stages
  stages = if is_centos? || is_rhel?
    [
      :system_network,
    ]
  else
    [
      :system_network,
      :system_openstack_clock,
      :system_openstack_modules,
    ]
  end

  stages += [
    :system_parameters,
    :bosh_clean,
    :bosh_harden,
    :bosh_openstack_agent_settings,
    :bosh_clean_ssh,
    :image_create,
    :image_install_grub,
  ]
end
ovf_package_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 317
def ovf_package_stages
  [
    :image_ovf_vmx,
    :image_ovf_generate,
    :prepare_ovf_image_stemcell,
  ]
end
photonos_os_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 275
def photonos_os_stages
  [
    :base_photonos,
    :base_file_permission,
    bosh_steps,
    :base_ssh,
    :rsyslog_config,
    :delay_monit_start,
    :system_grub,
    :cron_config,
  ].flatten
end
qcow2_package_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 311
def qcow2_package_stages
  [
    :prepare_qcow2_image_stemcell,
  ]
end
raw_package_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 299
def raw_package_stages
  [
    :prepare_raw_image_stemcell,
  ]
end
rawdisk_package_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 305
def rawdisk_package_stages
  [
    :prepare_rawdisk_image_stemcell,
  ]
end
rhel_os_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 230
def rhel_os_stages
  [
    :base_rhel,
    :base_runsvdir,
    :base_centos_packages,
    :base_file_permission,
    :base_ssh,
    :system_kernel_modules,
    bosh_steps,
    :rsyslog_config,
    :delay_monit_start,
    :system_grub,
    :rhel_unsubscribe,
    :cron_config,
  ].flatten
end
softlayer_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 185
def softlayer_stages
  [
      :system_network,
      :system_softlayer_open_iscsi,
      :system_softlayer_multipath_tools,
      :disable_blank_passwords,
      :system_parameters,
      :bosh_clean,
      :bosh_harden,
      :bosh_enable_password_authentication,
      :bosh_softlayer_agent_settings,
      :bosh_clean_ssh,
      :image_create,
      :image_install_grub,
  ]
end
ubuntu_os_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 247
def ubuntu_os_stages
  [
    :base_debootstrap,
    :base_ubuntu_firstboot,
    :base_apt,
    :base_ubuntu_build_essential,
    :base_ubuntu_packages,
    :base_file_permission,
    :base_ssh,
    :bosh_sysstat,
    :system_kernel,
    :system_kernel_modules,
    :system_ixgbevf,
    bosh_steps,
    :password_policies,
    :tty_config,
    :rsyslog_config,
    :delay_monit_start,
    :system_grub,
    :vim_tiny,
    :cron_config,
    :escape_ctrl_alt_del,
    :system_users,
    :bosh_audit,
    :bosh_log_audit_start,
  ].flatten.reject{ |s| Bosh::Stemcell::Arch.ppc64le? and s ==  :system_ixgbevf }
end
vhd_package_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 325
def vhd_package_stages
  [
    :prepare_vhd_image_stemcell,
  ]
end
vsphere_vcloud_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 111
def vsphere_vcloud_stages
  [
    :system_network,
    :system_open_vm_tools,
    :system_vsphere_cdrom,
    :system_parameters,
    :bosh_clean,
    :bosh_harden,
    :bosh_enable_password_authentication,
    :bosh_vsphere_agent_settings,
    :bosh_clean_ssh,
    :image_create,
    :image_install_grub,
  ]
end
warden_stages() click to toggle source
# File lib/bosh/stemcell/stage_collection.rb, line 157
def warden_stages
  [
    :system_parameters,
    :base_warden,
    :bosh_clean,
    :bosh_harden,
    :bosh_enable_password_authentication,
    :bosh_clean_ssh,
    :image_create,
    :image_install_grub,
  ]
end