Puppet Class: tripleo::profile::base::nova::migration::client

Defined in:
manifests/profile/base/nova/migration/client.pp

Overview

Parameters:

  • libvirt_enabled (Any) (defaults to: false)
  • nova_compute_enabled (Any) (defaults to: false)
  • step (Any) (defaults to: Integer(hiera('step')))
  • ssh_private_key (Any) (defaults to: '')
  • ssh_port (Any) (defaults to: 22)
  • libvirt_tls (Any) (defaults to: false)


45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'manifests/profile/base/nova/migration/client.pp', line 45

class tripleo::profile::base::nova::migration::client (
  $libvirt_enabled          = false,
  $nova_compute_enabled     = false,
  $step                     = Integer(hiera('step')),
  $ssh_private_key          = '',
  $ssh_port                 = 22,
  $libvirt_tls              = false,
) {

  include tripleo::profile::base::nova::migration

  if $step >= 4 {

    # Libvirt setup (live-migration)
    if $libvirt_tls {
      class { 'nova::migration::libvirt':
        transport         => 'tls',
        configure_libvirt => $libvirt_enabled,
        configure_nova    => $nova_compute_enabled,
        auth              => 'sasl'
      }
    } else {
      # Reuse the cold-migration SSH tunnel when TLS is not enabled
      class { 'nova::migration::libvirt':
        transport          => 'ssh',
        configure_libvirt  => $libvirt_enabled,
        configure_nova     => $nova_compute_enabled,
        client_user        => 'nova_migration',
        client_extraparams => {
          'keyfile' => '/etc/nova/migration/identity',
          'proxy'   => 'netcat',
        },
        client_port        => $ssh_port
      }
    }

    if !empty($ssh_private_key) {
      # Nova SSH tunnel setup (cold-migration)
      $migration_identity = $ssh_private_key
    }
    else {
      $migration_identity = '# Migration over SSH disabled by TripleO'
    }

    file { '/etc/nova/migration/identity':
      content => $migration_identity,
      mode    => '0600',
      owner   => 'nova',
      group   => 'nova',
      require => Package['openstack-nova-migration']
    }

    file_line { 'nova_ssh_port':
      ensure => present,
      path   => '/var/lib/nova/.ssh/config',
      after  => '^Host \*$',
      line   => "    Port ${ssh_port}",
    }
  }
}