puppet 部署 horizon server 所需的参数和部署逻辑

所需要的参数:
  $secret_key,
  $bind_address = '127.0.0.1',
  $cache_server_ip = '127.0.0.1',
  $cache_server_port = '11211',
  $swift = false,
  $quantum = false,
  $package_ensure = present,
  $horizon_app_links = false,
  $keystone_host = '127.0.0.1',
  $keystone_port = 5000,
  $keystone_scheme = 'http',
  $keystone_default_role = 'Member',
  $django_debug = false,
  $django_verbose = false,
  $api_result_limit = 1000,
  $http_port = 80,
  $https_port = 443,
  $use_ssl = false,
  $log_level = 'WARNING',
  $use_syslog = false,
 
$logdir = '/var/log/horizon'
      $http_service = 'httpd'
      $vhosts_file = '/etc/httpd/conf.d/ssl.conf'
      $http_modwsgi = 'mod_wsgi'
      $package_name = 'openstack-dashboard'
      $horizon_additional_packages = ['nodejs', 'nodejs-less', 'python-lesscpy']
      $httpd_listen_config_file = '/etc/httpd/conf.d/ports.conf'
      $local_settings_path = '/etc/openstack-dashboard/local_settings'
      $root_url = '/dashboard'
      $apache_user = 'apache'
      $apache_group = 'apache'
      $apache_confdir = ['/etc/httpd', '/etc/httpd/conf.d']
      $ssl_key_group = 'root'
      $ssl_cert_file = '/etc/pki/tls/certs/localhost.crt'
      $ssl_key_file = '/etc/pki/tls/private/localhost.key'
      $ssl_cert_type = 'crt'
      $dashboard_http_conf_file = '/etc/httpd/conf.d/openstack-dashboard.conf'
      $apache_tuning_file = '/etc/httpd/conf.d/zzz_performance_tuning.conf'
 
安装流程:
1、安装 apache和mod_wsgi
2、安装 openstack-dashboard(必须在1安装完成后)
3、为dashboard添加用户和用户组apache
4、为/etc/openstack-dashboard/local_settings添加内容和644权限
5、创建/usr/share/openstack-dashboard/目录
6、执行chrown -r apache:apache /usr/share/openstack-dashboard/
7、用户证书判断 case $use_ssl {...} 默认$use_ssl为false,这里采用默认的 package certificate生成$generate_sslcert_name和$inject_certs
8、设置 $ssl_cert_file和 $ssl_key_file 根据上面的默认选项生成的$generate_sslcert_name 
9、注入签名证书 默认生成的$inject_certs为FALSE  所以这不会执行
10、生成/var/log/horizon目录,接着生成horizon.log文件,他们所属的用户用户组为apache
11、确认资源间的执行顺序Package["dashboard"] -> File[$horizon::params::logdir]
  File["${horizon::params::logdir}/horizon.log"] -> Service['httpd']
12、/etc/httpd/conf.d/ssl.conf文件,内容为模板horizon/vhosts.erb,权限644,修改这个文件后重启httpd服务
13、/etc/httpd/conf.d/openstack-dashboard.conf文件,内容为horizon/openstack-dashboard.conf.erb模板,权限644,修改后重启httpd服务,需要'/etc/httpd', '/etc/httpd/conf.d存在
14、/etc/httpd/conf.d/zzz_performance_tuning.conf文件,内容horizon/zzz_performance_tuning.conf.erb模板,模式644,修改后重启httpd服务,需要'/etc/httpd', '/etc/httpd/conf.d存在
15、/etc/httpd/conf.d/ports.conf文件,为内容horizon/ports.conf.erb,所属用户、用户组均为root,修改后重启httpd服务,需要在httpd安装前执行,需要'/etc/httpd', '/etc/httpd/conf.d存在
16、['/etc/httpd', '/etc/httpd/conf.d']目录,所属用户、用户组均为root
17、安装nodejs', 'nodejs-less', 'python-lesscpy‘
18、/etc/httpd/conf.d/wsgi.conf文件,模式644,所属用户、用户组均为root,内容:"LoadModule wsgi_module modules/mod_wsgi.so\n",需要在apache和mod_wsgi安装后,在dashboard安装前执行
19、在httpd服务启动前,安装mod_ssl
20、文件/etc/sysconfig/httpd 模式644,所属用户、用户组均为root,内容:horizon/redhat_sysconfig_httpd.erb模板,需要安装httpd,修改后重启httpd服务
21、修改"/files/etc/httpd/conf/httpd.conf",删除Listen指令,需要在httpd服务启动前
22、horizon_compress_styles命令:在/usr/share/openstack-dashboard  python manage.py compress
安装 dashboard后执行命令  安装完nodejs', 'nodejs-less', 'python-lesscpy后执行命令  
执行完 horizon_compress_styles命令 重启httpd服务
23、确定httpd服务开启
24、文件执行顺序  File[$::horizon::params::local_settings_path, $::horizon::params::logdir] ~> Service['httpd']
  Package[$::horizon::params::http_service, $::horizon::params::http_modwsgi] -> Service['httpd']
  Package<| title == $::horizon::params::http_service or title == $::horizon::params::http_modwsgi|> ~>
  Service<| title == 'httpd'|>
25 如果$cache_server_ip 不是127.0.0.1 就先执行 Class['memcached']
上一篇:jmeter抓包之APP


下一篇:yum update 自动忽略内核更新