From dd854d99880f997d1c73d346d21c42ad02489e24 Mon Sep 17 00:00:00 2001 From: Ivan Udovichenko Date: Mon, 5 Dec 2016 20:21:15 +0300 Subject: [PATCH] Ensure that memcached service is installed and running Currently App catalog with Glare will not allow to log in if memcached service is not running. Other minor changes to get rid of lintian warnings. Add retries to assets import due to timeouts from time to time. spec/acceptance/nodesets/ : - nodepool-centos7.yml : * Make host file compatible with beaker-hostgenerator 1.x - nodepool-xenial.yml : * Add host file for Xenial. Change-Id: Id5466d346b2fd3e67bb8d0c3a9e5f6ad9d586b45 --- examples/app_site_with_glare_using_git.pp | 10 +++++----- manifests/catalog.pp | 10 +++++++--- manifests/plugins/glare.pp | 10 +++++++++- metadata.json | 3 ++- spec/acceptance/nodesets/nodepool-centos7.yml | 2 +- spec/acceptance/nodesets/nodepool-xenial.yml | 10 ++++++++++ 6 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 spec/acceptance/nodesets/nodepool-xenial.yml diff --git a/examples/app_site_with_glare_using_git.pp b/examples/app_site_with_glare_using_git.pp index 02113c7..cc64904 100644 --- a/examples/app_site_with_glare_using_git.pp +++ b/examples/app_site_with_glare_using_git.pp @@ -17,11 +17,11 @@ if $use_ssl { $import_assets = true class { '::apps_site': - without_glare => $without_glare, - use_pip => false, - use_git => true, - repo_url => $repo_url, - commit => $commit, + without_glare => $without_glare, + use_pip => false, + use_git => true, + repo_url => $repo_url, + commit => $commit, } class { '::apps_site::plugins::glare': diff --git a/manifests/catalog.pp b/manifests/catalog.pp index dced94b..f05c651 100644 --- a/manifests/catalog.pp +++ b/manifests/catalog.pp @@ -44,9 +44,13 @@ class apps_site::catalog ( } exec { 'import-glare-assets' : - command => "app-catalog-import-assets --glare_url ${glare_url} --assets_file ${real_assets_file}", - path => ['/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin', '/usr/local/sbin'], - require => [Package['openstack-app-catalog'], Exec['app-catalog-compress']], + command => "app-catalog-import-assets --glare_url ${glare_url} --assets_file ${real_assets_file}", + path => ['/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin', '/usr/local/sbin'], + refreshonly => true, + try_sleep => 5, + tries => 10, + logoutput => on_failure, + require => [Package['openstack-app-catalog'], Exec['app-catalog-compress']], } } } diff --git a/manifests/plugins/glare.pp b/manifests/plugins/glare.pp index 9feab58..34db1d9 100644 --- a/manifests/plugins/glare.pp +++ b/manifests/plugins/glare.pp @@ -3,6 +3,7 @@ class apps_site::plugins::glare ( $vhost_name = $::fqdn, $memcache_server = '127.0.0.1:11211', + $memcached_listen_ip = '127.0.0.1', $cookie_name = 's.aoo', $use_ssl = false, $ssl_cert_file_content = undef, @@ -14,6 +15,10 @@ class apps_site::plugins::glare ( $extra_params = '--config-file /usr/local/etc/glare/glare.conf' ) inherits ::apps_site::params { + class { '::memcached': + listen_ip => $memcached_listen_ip, + } + package { 'glare_dev': ensure => present, provider => 'pip', @@ -36,7 +41,10 @@ class apps_site::plugins::glare ( logoutput => on_failure, } - Package['glare_dev'] ~> Exec['glare-db-sync'] -> Service['glare-api'] + Class['memcached'] -> + Package['glare_dev'] ~> + Exec['glare-db-sync'] -> + Service['glare-api'] # include ::glare::params # include ::glare::db::sync diff --git a/metadata.json b/metadata.json index b5e677c..b348a97 100644 --- a/metadata.json +++ b/metadata.json @@ -10,6 +10,7 @@ "dependencies": [ { "name": "openstackinfra/vcsrepo","version_requirement":">= 0.0.8"}, { "name": "openstackinfra/httpd", "version_requirement": "0.x" }, - { "name": "puppetlabs/apache", "version_requirement": ">=1.6.0" } + { "name": "puppetlabs/apache", "version_requirement": ">=1.6.0" }, + { "name": "saz/memcached", "version_requirement": ">=2.7.1" } ] } diff --git a/spec/acceptance/nodesets/nodepool-centos7.yml b/spec/acceptance/nodesets/nodepool-centos7.yml index c552874..e9457d5 100644 --- a/spec/acceptance/nodesets/nodepool-centos7.yml +++ b/spec/acceptance/nodesets/nodepool-centos7.yml @@ -2,7 +2,7 @@ HOSTS: centos-70-x64: roles: - master - platform: el-7-x86_64 + platform: 7-x86_64 hypervisor: none ip: 127.0.0.1 CONFIG: diff --git a/spec/acceptance/nodesets/nodepool-xenial.yml b/spec/acceptance/nodesets/nodepool-xenial.yml new file mode 100644 index 0000000..99dd318 --- /dev/null +++ b/spec/acceptance/nodesets/nodepool-xenial.yml @@ -0,0 +1,10 @@ +HOSTS: + ubuntu-16.04-amd64: + roles: + - master + platform: ubuntu-16.04-amd64 + hypervisor: none + ip: 127.0.0.1 +CONFIG: + type: foss + set_env: false