From 273400fd766925b04dcd221a171d70f2f7ea7234 Mon Sep 17 00:00:00 2001 From: "Elizabeth K. Joseph" Date: Wed, 28 Jan 2015 09:55:29 -0800 Subject: [PATCH] Split out reviewday module Change-Id: If7716164ecd5bc5d4432758a13b1c7efef571aa9 --- modules.env | 1 + modules/reviewday/manifests/init.pp | 50 ---------- modules/reviewday/manifests/site.pp | 108 --------------------- modules/reviewday/templates/ssh_config.erb | 7 -- 4 files changed, 1 insertion(+), 165 deletions(-) delete mode 100644 modules/reviewday/manifests/init.pp delete mode 100644 modules/reviewday/manifests/site.pp delete mode 100644 modules/reviewday/templates/ssh_config.erb diff --git a/modules.env b/modules.env index 71860fde82..a9460a0c49 100644 --- a/modules.env +++ b/modules.env @@ -78,6 +78,7 @@ INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-httpd"]="o INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-openstackid"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-redis"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-ssh"]="origin/master" +INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-reviewday"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-drupal"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-mediawiki"]="origin/master" diff --git a/modules/reviewday/manifests/init.pp b/modules/reviewday/manifests/init.pp deleted file mode 100644 index 84847e6e3d..0000000000 --- a/modules/reviewday/manifests/init.pp +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# Class: reviewday -# -class reviewday { - if ! defined(Package['python-launchpadlib']) { - package { 'python-launchpadlib': - ensure => present, - } - } - package { 'python-cheetah': - ensure => present, - } - - file {'/var/lib/reviewday': - ensure => directory, - owner => 'reviewday', - group => 'reviewday', - mode => '0755', - require => User['reviewday'], - } - - group { 'reviewday': - ensure => present, - } - - user { 'reviewday': - ensure => present, - home => '/var/lib/reviewday', - shell => '/bin/bash', - gid => 'reviewday', - managehome => true, - require => Group['reviewday'], - } - -} - -# vim:sw=2:ts=2:expandtab:textwidth=79 diff --git a/modules/reviewday/manifests/site.pp b/modules/reviewday/manifests/site.pp deleted file mode 100644 index 83814c2222..0000000000 --- a/modules/reviewday/manifests/site.pp +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# == Define: reviewday -# -define reviewday::site( - $gerrit_url = '', - $gerrit_port = '', - $gerrit_user = '', - $reviewday_rsa_key_contents = '', - $reviewday_rsa_pubkey_contents = '', - $reviewday_gerrit_ssh_key = '', - $git_url = '', - $httproot = '', - $serveradmin = '' -) { - - file { '/var/lib/reviewday/.ssh/': - ensure => directory, - owner => 'reviewday', - group => 'reviewday', - mode => '0700', - require => User['reviewday'], - } - - if $reviewday_rsa_key_contents != '' { - file { '/var/lib/reviewday/.ssh/id_rsa': - owner => 'reviewday', - group => 'reviewday', - mode => '0600', - content => $reviewday_rsa_key_contents, - replace => true, - require => File['/var/lib/reviewday/.ssh/'] - } - } - - if $reviewday_rsa_pubkey_contents != '' { - file { '/var/lib/reviewday/.ssh/id_rsa.pub': - owner => 'reviewday', - group => 'reviewday', - mode => '0600', - content => $reviewday_rsa_pubkey_contents, - replace => true, - require => File['/var/lib/reviewday/.ssh/'] - } - } - - if $reviewday_gerrit_ssh_key != '' { - file { '/var/lib/reviewday/.ssh/known_hosts': - owner => 'reviewday', - group => 'reviewday', - mode => '0600', - content => "${gerrit_url} ${reviewday_gerrit_ssh_key}", - replace => true, - require => File['/var/lib/reviewday/.ssh/'] - } - } - - file {'/var/lib/reviewday/reviewday': - ensure => directory, - owner => 'reviewday', - group => 'reviewday', - mode => '0755', - require => File['/var/lib/reviewday/'], - } - - vcsrepo { '/var/lib/reviewday/reviewday': - ensure => latest, - provider => git, - source => $git_url, - revision => 'master', - } - - file { $httproot: - ensure => directory, - owner => 'reviewday', - group => 'reviewday', - mode => '0755', - } - - file { '/var/lib/reviewday/.ssh/config': - ensure => present, - content => template('reviewday/ssh_config.erb'), - owner => 'reviewday', - group => 'reviewday', - mode => '0644', - } - - cron { 'update reviewday': - command => "cd /var/lib/reviewday/reviewday && PYTHONPATH=\$PWD flock -n /var/lib/reviewday/update.lock python bin/reviewday -o ${httproot}", - minute => '*/30', - user => 'reviewday', - } - -} - -# vim:sw=2:ts=2:expandtab:textwidth=79 diff --git a/modules/reviewday/templates/ssh_config.erb b/modules/reviewday/templates/ssh_config.erb deleted file mode 100644 index d3273cf3ea..0000000000 --- a/modules/reviewday/templates/ssh_config.erb +++ /dev/null @@ -1,7 +0,0 @@ -Host review - Hostname <%= gerrit_url %> - Port <%= gerrit_port %> - User <%= gerrit_user %> - AddressFamily inet - IdentityFile /var/lib/reviewday/.ssh/id_rsa - UserKnownHostsFile /var/lib/reviewday/.ssh/known_hosts