try again, with puppetforge modules, correctly included now
[mirror/dsa-puppet.git] / 3rdparty / modules / neutron / manifests / plugins / ml2 / cisco / nexus_creds.pp
1 #
2 # Configure the Mech Driver for cisco neutron plugin
3 # More info available here:
4 # https://wiki.openstack.org/wiki/Neutron/ML2/MechCiscoNexus
5 #
6 #
7 # neutron::plugins::ml2::cisco::nexus_creds used by
8 # neutron::plugins::ml2::cisco::nexus
9 #
10
11 define neutron::plugins::ml2::cisco::nexus_creds(
12   $username,
13   $password,
14   $servers,
15   $ip_address,
16   $ssh_port
17 ) {
18
19   file {'/var/lib/neutron/.ssh':
20     ensure  => directory,
21     owner   => 'neutron',
22     require => Package['neutron-server']
23   }
24
25   exec {'nexus_creds':
26     unless  => "/bin/cat /var/lib/neutron/.ssh/known_hosts | /bin/grep ${username}",
27     command => "/usr/bin/ssh-keyscan -t rsa ${ip_address} >> /var/lib/neutron/.ssh/known_hosts",
28     user    => 'neutron',
29     require => [Package['neutron-server'], File['/var/lib/neutron/.ssh']]
30   }
31 }