Stop disabling selinux
[releng.git] / prototypes / puppet-infracloud / modules / opnfv / manifests / controller.pp
1 # SPDX-license-identifier: Apache-2.0
2 ##############################################################################
3 # Copyright (c) 2016 RedHat and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 class opnfv::controller (
10   $keystone_rabbit_password,
11   $neutron_rabbit_password,
12   $nova_rabbit_password,
13   $root_mysql_password,
14   $keystone_mysql_password,
15   $glance_mysql_password,
16   $neutron_mysql_password,
17   $nova_mysql_password,
18   $glance_admin_password,
19   $keystone_admin_password,
20   $neutron_admin_password,
21   $nova_admin_password,
22   $keystone_admin_token,
23   $ssl_key_file_contents,
24   $ssl_cert_file_contents,
25   $br_name,
26   $controller_public_address = $::fqdn,
27   $neutron_subnet_cidr,
28   $neutron_subnet_gateway,
29   $neutron_subnet_allocation_pools,
30   $opnfv_password,
31   $opnfv_email = 'opnfvuser@gmail.com',
32 ) {
33   class { '::infracloud::controller':
34     keystone_rabbit_password         => $keystone_rabbit_password,
35     neutron_rabbit_password          => $neutron_rabbit_password,
36     nova_rabbit_password             => $nova_rabbit_password,
37     root_mysql_password              => $root_mysql_password,
38     keystone_mysql_password          => $keystone_mysql_password,
39     glance_mysql_password            => $glance_mysql_password,
40     neutron_mysql_password           => $neutron_mysql_password,
41     nova_mysql_password              => $nova_mysql_password,
42     keystone_admin_password          => $keystone_admin_password,
43     glance_admin_password            => $glance_admin_password,
44     neutron_admin_password           => $neutron_admin_password,
45     nova_admin_password              => $nova_admin_password,
46     keystone_admin_token             => $keystone_admin_token,
47     ssl_key_file_contents            => $ssl_key_file_contents,
48     ssl_cert_file_contents           => $ssl_cert_file_contents,
49     br_name                          => $br_name,
50     controller_public_address        => $controller_public_address,
51     neutron_subnet_cidr              => $neutron_subnet_cidr,
52     neutron_subnet_gateway           => $neutron_subnet_gateway,
53     neutron_subnet_allocation_pools  => $neutron_subnet_allocation_pools,
54   }
55
56   # create keystone creds
57   keystone_domain { 'opnfv':
58     ensure  => present,
59     enabled => true,
60   }
61
62   keystone_tenant { 'opnfv':
63     ensure      => present,
64     enabled     => true,
65     description => 'OPNFV cloud',
66     domain      => 'opnfv',
67     require     => Keystone_domain['opnfv'],
68   }
69
70   keystone_user { 'opnfv':
71     ensure   => present,
72     enabled  => true,
73     domain   => 'opnfv',
74     email    => $opnfv_email,
75     password => $opnfv_password,
76     require  => Keystone_tenant['opnfv'],
77   }
78
79   keystone_role { 'user': ensure => present }
80
81   keystone_user_role { 'opnfv::opnfv@opnfv::opnfv':
82     roles => [ 'user', 'admin', ],
83   }
84 }
85