diff --git a/install_jenkins_slave.sh b/install_jenkins_slave.sh index 740301ff0f..a59869942e 100755 --- a/install_jenkins_slave.sh +++ b/install_jenkins_slave.sh @@ -48,4 +48,4 @@ fi git clone https://git.openstack.org/openstack-infra/config bash config/install_modules.sh -puppet apply --modulepath=`pwd`/config/modules:/etc/puppet/modules -e 'node default {class { "openstack_project::bare_slave": install_users => false }}' +puppet apply --modulepath=`pwd`/config/modules:/etc/puppet/modules -e 'node default {class { "openstack_project::simple_slave": install_users => false }}' diff --git a/modules/jenkins/manifests/params.pp b/modules/jenkins/manifests/params.pp index 9a60bb7eaa..f7b64f6311 100644 --- a/modules/jenkins/manifests/params.pp +++ b/modules/jenkins/manifests/params.pp @@ -11,57 +11,8 @@ class jenkins::params { $ccache_package = 'ccache' $python_netaddr_package = 'python-netaddr' $haveged_package = 'haveged' - # packages needed by slaves - $ant_package = 'ant' - $awk_package = 'gawk' - $asciidoc_package = 'asciidoc' - $curl_package = 'curl' - $docbook_xml_package = 'docbook-style-xsl' - $docbook5_xml_package = 'docbook5-schemas' - $docbook5_xsl_package = 'docbook5-style-xsl' - $firefox_package = 'firefox' - $graphviz_package = 'graphviz' - $mod_wsgi_package = 'mod_wsgi' - $libcurl_dev_package = 'libcurl-devel' - $ldap_dev_package = 'openldap-devel' - $librrd_dev_package = 'rrdtool-devel' - # packages needed by document translation - $gnome_doc_package = 'gnome-doc-utils' - $libtidy_package = 'libtidy' - $gettext_package = 'gettext' - $language_fonts_packages = [] - # for keystone ldap auth integration - $libsasl_dev = 'cyrus-sasl-devel' - $nspr_dev_package = 'nspr-devel' - $sqlite_dev_package = 'sqlite-devel' - $libvirt_dev_package = 'libvirt-devel' - $libxml2_package = 'libxml2' - $libxml2_dev_package = 'libxml2-devel' - $libxslt_dev_package = 'libxslt-devel' - $libffi_dev_package = 'libffi-devel' # FIXME: No Maven packages on RHEL #$maven_package = 'maven' - # For tooz unit tests - $memcached_package = 'memcached' - # For Ceilometer unit tests - $mongodb_package = 'mongodb-server' - $pandoc_package = 'pandoc' - $pkgconfig_package = 'pkgconfig' - $python_libvirt_package = 'libvirt-python' - $python_lxml_package = 'python-lxml' - $python_magic_package = 'python-magic' - $python_requests_package = 'python-requests' - $python_zmq_package = 'python-zmq' - $rubygems_package = 'rubygems' - # Common Lisp interpreter, used for cl-openstack-client - $sbcl_package = 'sbcl' - $sqlite_package = 'sqlite' - $unzip_package = 'unzip' - $zip_package = 'zip' - $xslt_package = 'libxslt' - $xvfb_package = 'xorg-x11-server-Xvfb' - # PHP package, used for community portal - $php5_cli_package = 'php-cli' # FIXME: No php mcrypt package on RHEL, used for openstackid #$php5_mcrypt_package = '' # For Tooz unit tests @@ -99,60 +50,12 @@ class jenkins::params { $ccache_package = 'ccache' $python_netaddr_package = 'python-netaddr' $haveged_package = 'haveged' - # packages needed by slaves - $ant_package = 'ant' - $awk_package = 'gawk' - $asciidoc_package = 'asciidoc' - $curl_package = 'curl' - $docbook_xml_package = 'docbook-xml' - $docbook5_xml_package = 'docbook5-xml' - $docbook5_xsl_package = 'docbook-xsl' - $firefox_package = 'firefox' - $graphviz_package = 'graphviz' - $mod_wsgi_package = 'libapache2-mod-wsgi' - $libcurl_dev_package = 'libcurl4-gnutls-dev' - $ldap_dev_package = 'libldap2-dev' - $librrd_dev_package = 'librrd-dev' - # packages needed by document translation - $gnome_doc_package = 'gnome-doc-utils' - $libtidy_package = 'libtidy-0.99-0' - $gettext_package = 'gettext' - $language_fonts_packages = ['fonts-takao', 'fonts-nanum'] - # for keystone ldap auth integration - $libsasl_dev = 'libsasl2-dev' - $mysql_dev_package = 'libmysqlclient-dev' - $nspr_dev_package = 'libnspr4-dev' - $sqlite_dev_package = 'libsqlite3-dev' - $libvirt_dev_package = 'libvirt-dev' - $libxml2_package = 'libxml2-utils' - $libxml2_dev_package = 'libxml2-dev' - $libxslt_dev_package = 'libxslt1-dev' - $libffi_dev_package = 'libffi-dev' $maven_package = 'maven2' # For tooz unit tests $memcached_package = 'memcached' - # For Ceilometer unit tests - $mongodb_package = 'mongodb' - $pandoc_package = 'pandoc' - $pkgconfig_package = 'pkg-config' - $python_libvirt_package = 'python-libvirt' - $python_lxml_package = 'python-lxml' - $python_magic_package = 'python-magic' - $python_requests_package = 'python-requests' - $python_zmq_package = 'python-zmq' - $rubygems_package = 'rubygems' $ruby1_9_1_package = 'ruby1.9.1' $ruby1_9_1_dev_package = 'ruby1.9.1-dev' $ruby_bundler_package = 'ruby-bundler' - # Common Lisp interpreter, used for cl-openstack-client - $sbcl_package = 'sbcl' - $sqlite_package = 'sqlite3' - $unzip_package = 'unzip' - $zip_package = 'zip' - $xslt_package = 'xsltproc' - $xvfb_package = 'xvfb' - # PHP package, used for community portal - $php5_cli_package = 'php5-cli' $php5_mcrypt_package = 'php5-mcrypt' # For [tooz, taskflow, nova] using zookeeper in unit tests $zookeeper_package = 'zookeeperd' diff --git a/modules/jenkins/manifests/slave.pp b/modules/jenkins/manifests/slave.pp index 764b6dabc8..d83d815a0d 100644 --- a/modules/jenkins/manifests/slave.pp +++ b/modules/jenkins/manifests/slave.pp @@ -3,11 +3,8 @@ class jenkins::slave( $ssh_key = '', $sudo = false, - $bare = false, $user = true, $python3 = false, - $include_pypy = false, - $all_mysql_privs = false, ) { include pip @@ -23,66 +20,13 @@ class jenkins::slave( anchor { 'jenkins::slave::update-java-alternatives': } # Packages that all jenkins slaves need - $common_packages = [ + $packages = [ $::jenkins::params::jdk_package, # jdk for building java jobs $::jenkins::params::ccache_package, $::jenkins::params::python_netaddr_package, # Needed for devstack address_in_net() $::jenkins::params::haveged_package, # entropy is useful to have ] - # Packages that most jenkins slaves (eg, unit test runners) need - $standard_packages = [ - $::jenkins::params::ant_package, # for building buck - $::jenkins::params::awk_package, # for building extract_docs.awk to work correctly - $::jenkins::params::asciidoc_package, # for building gerrit/building openstack docs - $::jenkins::params::curl_package, - $::jenkins::params::docbook_xml_package, # for building openstack docs - $::jenkins::params::docbook5_xml_package, # for building openstack docs - $::jenkins::params::docbook5_xsl_package, # for building openstack docs - $::jenkins::params::gettext_package, # for msgfmt, used in translating manuals - $::jenkins::params::gnome_doc_package, # for generating translation files for docs - $::jenkins::params::graphviz_package, # for generating graphs in docs - $::jenkins::params::firefox_package, # for selenium tests - $::jenkins::params::mod_wsgi_package, - $::jenkins::params::language_fonts_packages, - $::jenkins::params::libcurl_dev_package, - $::jenkins::params::ldap_dev_package, - $::jenkins::params::librrd_dev_package, # for python-rrdtool, used by kwapi - $::jenkins::params::libtidy_package, # for python-tidy, used by sphinxcontrib-docbookrestapi - $::jenkins::params::libsasl_dev, # for keystone ldap auth integration - $::jenkins::params::memcached_package, # for tooz unit tests - $::jenkins::params::mongodb_package, # for ceilometer unit tests - $::jenkins::params::mysql_dev_package, - $::jenkins::params::nspr_dev_package, # for spidermonkey, used by ceilometer - $::jenkins::params::sqlite_dev_package, - $::jenkins::params::libvirt_dev_package, - $::jenkins::params::libxml2_package, - $::jenkins::params::libxml2_dev_package, # for xmllint, need for wadl - $::jenkins::params::libxslt_dev_package, - $::jenkins::params::libffi_dev_package, # xattr's cffi dependency - $::jenkins::params::pandoc_package, #for docs, markdown->docbook, bug 924507 - $::jenkins::params::pkgconfig_package, # for spidermonkey, used by ceilometer - $::jenkins::params::python_libvirt_package, - $::jenkins::params::python_lxml_package, # for validating openstack manuals - $::jenkins::params::python_magic_package, # for pushing files to swift - $::jenkins::params::python_requests_package, # for pushing files to swift - $::jenkins::params::python_zmq_package, # zeromq unittests (not pip installable) - $::jenkins::params::rubygems_package, - $::jenkins::params::sbcl_package, # cl-openstack-client testing - $::jenkins::params::sqlite_package, - $::jenkins::params::unzip_package, - $::jenkins::params::zip_package, - $::jenkins::params::xslt_package, # for building openstack docs - $::jenkins::params::xvfb_package, # for selenium tests - $::jenkins::params::php5_cli_package, # for community portal build - ] - - if ($bare == false) { - $packages = [$common_packages, $standard_packages] - } else { - $packages = $common_packages - } - file { '/etc/apt/sources.list.d/cloudarchive.list': ensure => absent, } @@ -169,29 +113,6 @@ class jenkins::slave( } } - if ($bare == false) { - # pin to a release of rake which works with ruby 1.8.x - # before PSH tries to pull in a newer one which isn't - package { 'rake': - ensure => '10.1.1', - provider => gem, - before => Package['puppetlabs_spec_helper'], - require => Package['rubygems'], - } - - $gem_packages = [ - 'bundler', - 'puppet-lint', - 'puppetlabs_spec_helper', - ] - - package { $gem_packages: - ensure => latest, - provider => gem, - require => Package['rubygems'], - } - } - if $python3 { if ($::lsbdistcodename == 'precise') { apt::ppa { 'ppa:zulcss/py3k': @@ -252,145 +173,6 @@ class jenkins::slave( require => Package['ccache'], } - if ($bare == false) { - if ($::operatingsystem == 'Fedora') and ($::operatingsystemrelease >= 19) { - class {'mysql::server': - config_hash => { - 'root_password' => 'insecure_slave', - 'default_engine' => 'MyISAM', - 'bind_address' => '127.0.0.1', - }, - package_name => 'community-mysql-server', - } - } else { - class {'mysql::server': - config_hash => { - 'root_password' => 'insecure_slave', - 'default_engine' => 'MyISAM', - 'bind_address' => '127.0.0.1', - } - } - } - - include mysql::server::account_security - - mysql::db { 'openstack_citest': - user => 'openstack_citest', - password => 'openstack_citest', - host => 'localhost', - grant => ['all'], - require => [ - Class['mysql::server'], - Class['mysql::server::account_security'], - ], - } - - # mysql::db is too dumb to realize that the same user can have - # access to multiple databases and will fail if you try creating - # a second DB with the same user. Create the DB directly as mysql::db - # above is creating the user for us. - database { 'openstack_baremetal_citest': - ensure => present, - charset => 'utf8', - provider => 'mysql', - require => [ - Class['mysql::server'], - Class['mysql::server::account_security'], - ], - } - - database_grant { 'openstack_citest@localhost/openstack_baremetal_citest': - privileges => ['all'], - provider => 'mysql', - require => Database_user['openstack_citest@localhost'], - } - - if ($all_mysql_privs == true) { - database_grant { 'openstack_citest@localhost': - privileges => ['all'], - provider => 'mysql', - require => Database_user['openstack_citest@localhost'], - } - } - - # The puppetlabs postgres module does not manage the postgres user - # and group for us. Create them here to ensure concat can create - # dirs and files owned by this user and group. - user { 'postgres': - ensure => present, - gid => 'postgres', - system => true, - require => Group['postgres'], - } - - group { 'postgres': - ensure => present, - system => true, - } - - class { 'postgresql::server': - postgres_password => 'insecure_slave', - manage_firewall => false, - # The puppetlabs postgres module incorrectly quotes ip addresses - # in the postgres server config. Use localhost instead. - listen_addresses => ['localhost'], - require => [ - User['postgres'], - Class['postgresql::params'], - ], - } - - class { 'postgresql::lib::devel': - require => Class['postgresql::params'], - } - - # Create DB user and explicitly make it non superuser - # that can create databases. - postgresql::server::role { 'openstack_citest': - password_hash => postgresql_password('openstack_citest', 'openstack_citest'), - createdb => true, - superuser => false, - require => Class['postgresql::server'], - } - - postgresql::server::db { 'openstack_citest': - user => 'openstack_citest', - password => postgresql_password('openstack_citest', 'openstack_citest'), - grant => 'all', - require => [ - Class['postgresql::server'], - Postgresql::Server::Role['openstack_citest'], - ], - } - - # Alter the new database giving the test DB user ownership of the DB. - # This is necessary to make the nova unittests run properly. - postgresql_psql { 'ALTER DATABASE openstack_citest OWNER TO openstack_citest': - db => 'postgres', - refreshonly => true, - subscribe => Postgresql::Server::Db['openstack_citest'], - } - - postgresql::server::db { 'openstack_baremetal_citest': - user => 'openstack_citest', - password => postgresql_password('openstack_citest', 'openstack_citest'), - grant => 'all', - require => [ - Class['postgresql::server'], - Postgresql::Server::Role['openstack_citest'], - ], - } - - # Alter the new database giving the test DB user ownership of the DB. - # This is necessary to make the nova unittests run properly. - postgresql_psql { 'ALTER DATABASE openstack_baremetal_citest OWNER TO - openstack_citest': - db => 'postgres', - refreshonly => true, - subscribe => Postgresql::Server::Db['openstack_baremetal_citest'], - } - } - file { '/usr/local/jenkins': ensure => directory, owner => 'root', @@ -398,18 +180,6 @@ class jenkins::slave( mode => '0755', } - file { '/usr/local/jenkins/slave_scripts': - ensure => directory, - owner => 'root', - group => 'root', - mode => '0755', - recurse => true, - purge => true, - force => true, - require => File['/usr/local/jenkins'], - source => 'puppet:///modules/jenkins/slave_scripts', - } - if ($sudo == true) { file { '/etc/sudoers.d/jenkins-sudo': ensure => present, @@ -427,43 +197,4 @@ class jenkins::slave( group => 'root', mode => '0440', } - - vcsrepo { '/opt/requirements': - ensure => latest, - provider => git, - revision => 'master', - source => 'https://git.openstack.org/openstack/requirements', - } - - # Temporary for debugging glance launch problem - # https://lists.launchpad.net/openstack/msg13381.html - # NOTE(dprince): ubuntu only as RHEL6 doesn't have sysctl.d yet - if ($::osfamily == 'Debian') { - - file { '/etc/sysctl.d/10-ptrace.conf': - ensure => present, - source => 'puppet:///modules/jenkins/10-ptrace.conf', - owner => 'root', - group => 'root', - mode => '0444', - } - - exec { 'ptrace sysctl': - subscribe => File['/etc/sysctl.d/10-ptrace.conf'], - refreshonly => true, - command => '/sbin/sysctl -p /etc/sysctl.d/10-ptrace.conf', - } - - if $include_pypy { - apt::ppa { 'ppa:pypy/ppa': } - package { 'pypy': - ensure => present, - require => Apt::Ppa['ppa:pypy/ppa'] - } - package { 'pypy-dev': - ensure => present, - require => Apt::Ppa['ppa:pypy/ppa'] - } - } - } } diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_node.sh b/modules/openstack_project/files/nodepool/scripts/prepare_node.sh index fdbf096b06..2f9cab4e4a 100755 --- a/modules/openstack_project/files/nodepool/scripts/prepare_node.sh +++ b/modules/openstack_project/files/nodepool/scripts/prepare_node.sh @@ -18,7 +18,7 @@ HOSTNAME=$1 SUDO=$2 -BARE=$3 +THIN=$3 PYTHON3=${4:-false} PYPY=${5:-false} ALL_MYSQL_PRIVS=${6:-false} @@ -42,10 +42,10 @@ sudo git clone --depth=1 git://git.openstack.org/openstack-infra/config.git \ sudo /bin/bash /root/config/install_modules.sh if [ -z "$NODEPOOL_SSH_KEY" ] ; then sudo puppet apply --modulepath=/root/config/modules:/etc/puppet/modules \ - -e "class {'openstack_project::single_use_slave': sudo => $SUDO, bare => $BARE, python3 => $PYTHON3, include_pypy => $PYPY, all_mysql_privs => $ALL_MYSQL_PRIVS, }" + -e "class {'openstack_project::single_use_slave': sudo => $SUDO, thin => $THIN, python3 => $PYTHON3, include_pypy => $PYPY, all_mysql_privs => $ALL_MYSQL_PRIVS, }" else sudo puppet apply --modulepath=/root/config/modules:/etc/puppet/modules \ - -e "class {'openstack_project::single_use_slave': install_users => false, sudo => $SUDO, bare => $BARE, python3 => $PYTHON3, include_pypy => $PYPY, all_mysql_privs => $ALL_MYSQL_PRIVS, ssh_key => '$NODEPOOL_SSH_KEY', }" + -e "class {'openstack_project::single_use_slave': install_users => false, sudo => $SUDO, thin => $THIN, python3 => $PYTHON3, include_pypy => $PYPY, all_mysql_privs => $ALL_MYSQL_PRIVS, ssh_key => '$NODEPOOL_SSH_KEY', }" fi # The puppet modules should install unbound. Take the nameservers diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_node_bare.sh b/modules/openstack_project/files/nodepool/scripts/prepare_node_bare.sh index 31597067e4..c41ae01772 100755 --- a/modules/openstack_project/files/nodepool/scripts/prepare_node_bare.sh +++ b/modules/openstack_project/files/nodepool/scripts/prepare_node_bare.sh @@ -18,11 +18,11 @@ HOSTNAME=$1 SUDO='true' -BARE='false' +THIN='false' PYTHON3='false' PYPY='false' ALL_MYSQL_PRIVS='true' -./prepare_node.sh "$HOSTNAME" "$SUDO" "$BARE" "$PYTHON3" "$PYPY" "$ALL_MYSQL_PRIVS" +./prepare_node.sh "$HOSTNAME" "$SUDO" "$THIN" "$PYTHON3" "$PYPY" "$ALL_MYSQL_PRIVS" ./restrict_memory.sh diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_node_devstack.sh b/modules/openstack_project/files/nodepool/scripts/prepare_node_devstack.sh index 3b890686c8..45c1e885fd 100755 --- a/modules/openstack_project/files/nodepool/scripts/prepare_node_devstack.sh +++ b/modules/openstack_project/files/nodepool/scripts/prepare_node_devstack.sh @@ -18,9 +18,9 @@ HOSTNAME=$1 SUDO='true' -BARE='true' +THIN='true' -./prepare_node.sh "$HOSTNAME" "$SUDO" "$BARE" +./prepare_node.sh "$HOSTNAME" "$SUDO" "$THIN" sudo -u jenkins -i /opt/nodepool-scripts/prepare_devstack.sh $HOSTNAME ./restrict_memory.sh diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_node_devstack_new_kernel.sh b/modules/openstack_project/files/nodepool/scripts/prepare_node_devstack_new_kernel.sh index 0b6a485752..c2496ab09c 100755 --- a/modules/openstack_project/files/nodepool/scripts/prepare_node_devstack_new_kernel.sh +++ b/modules/openstack_project/files/nodepool/scripts/prepare_node_devstack_new_kernel.sh @@ -18,9 +18,9 @@ HOSTNAME=$1 SUDO='true' -BARE='true' +THIN='true' -./prepare_node.sh "$HOSTNAME" "$SUDO" "$BARE" +./prepare_node.sh "$HOSTNAME" "$SUDO" "$THIN" sudo -u jenkins -i /opt/nodepool-scripts/prepare_devstack_new_kernel.sh $HOSTNAME ./restrict_memory.sh diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_node_py3k.sh b/modules/openstack_project/files/nodepool/scripts/prepare_node_py3k.sh index c970be81b8..9b8be24cbb 100755 --- a/modules/openstack_project/files/nodepool/scripts/prepare_node_py3k.sh +++ b/modules/openstack_project/files/nodepool/scripts/prepare_node_py3k.sh @@ -18,11 +18,11 @@ HOSTNAME=$1 SUDO='false' -BARE='false' +THIN='false' PYTHON3='true' PYPY='true' ALL_MYSQL_PRIVS='true' -./prepare_node.sh "$HOSTNAME" "$SUDO" "$BARE" "$PYTHON3" "$PYPY" "$ALL_MYSQL_PRIVS" +./prepare_node.sh "$HOSTNAME" "$SUDO" "$THIN" "$PYTHON3" "$PYPY" "$ALL_MYSQL_PRIVS" ./fix_pip.sh ./restrict_memory.sh diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_node_tripleo.sh b/modules/openstack_project/files/nodepool/scripts/prepare_node_tripleo.sh index e1d0d83478..a6827db93b 100755 --- a/modules/openstack_project/files/nodepool/scripts/prepare_node_tripleo.sh +++ b/modules/openstack_project/files/nodepool/scripts/prepare_node_tripleo.sh @@ -18,11 +18,11 @@ HOSTNAME=$1 SUDO='true' -BARE='true' +THIN='true' # Workaround bug 1270646 during node bootstrapping. sudo ip link set mtu 1458 dev eth0 -./prepare_node.sh "$HOSTNAME" "$SUDO" "$BARE" +./prepare_node.sh "$HOSTNAME" "$SUDO" "$THIN" sudo -u jenkins -i /opt/nodepool-scripts/prepare_tripleo.sh $HOSTNAME sync diff --git a/modules/jenkins/files/slave_scripts/baremetal-archive-logs.sh b/modules/openstack_project/files/slave_scripts/baremetal-archive-logs.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/baremetal-archive-logs.sh rename to modules/openstack_project/files/slave_scripts/baremetal-archive-logs.sh diff --git a/modules/jenkins/files/slave_scripts/baremetal-deploy.sh b/modules/openstack_project/files/slave_scripts/baremetal-deploy.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/baremetal-deploy.sh rename to modules/openstack_project/files/slave_scripts/baremetal-deploy.sh diff --git a/modules/jenkins/files/slave_scripts/baremetal-os-install.sh b/modules/openstack_project/files/slave_scripts/baremetal-os-install.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/baremetal-os-install.sh rename to modules/openstack_project/files/slave_scripts/baremetal-os-install.sh diff --git a/modules/jenkins/files/slave_scripts/bump-milestone.sh b/modules/openstack_project/files/slave_scripts/bump-milestone.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/bump-milestone.sh rename to modules/openstack_project/files/slave_scripts/bump-milestone.sh diff --git a/modules/jenkins/files/slave_scripts/create-ppa-package.sh b/modules/openstack_project/files/slave_scripts/create-ppa-package.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/create-ppa-package.sh rename to modules/openstack_project/files/slave_scripts/create-ppa-package.sh diff --git a/modules/jenkins/files/slave_scripts/docbook-properties.sh b/modules/openstack_project/files/slave_scripts/docbook-properties.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/docbook-properties.sh rename to modules/openstack_project/files/slave_scripts/docbook-properties.sh diff --git a/modules/jenkins/files/slave_scripts/functions.sh b/modules/openstack_project/files/slave_scripts/functions.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/functions.sh rename to modules/openstack_project/files/slave_scripts/functions.sh diff --git a/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh b/modules/openstack_project/files/slave_scripts/gerrit-git-prep.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/gerrit-git-prep.sh rename to modules/openstack_project/files/slave_scripts/gerrit-git-prep.sh diff --git a/modules/jenkins/files/slave_scripts/jenkins-oom-grep.sh b/modules/openstack_project/files/slave_scripts/jenkins-oom-grep.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/jenkins-oom-grep.sh rename to modules/openstack_project/files/slave_scripts/jenkins-oom-grep.sh diff --git a/modules/jenkins/files/slave_scripts/jenkins-sudo-grep.sh b/modules/openstack_project/files/slave_scripts/jenkins-sudo-grep.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/jenkins-sudo-grep.sh rename to modules/openstack_project/files/slave_scripts/jenkins-sudo-grep.sh diff --git a/modules/jenkins/files/slave_scripts/jenkinsci-upload.sh b/modules/openstack_project/files/slave_scripts/jenkinsci-upload.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/jenkinsci-upload.sh rename to modules/openstack_project/files/slave_scripts/jenkinsci-upload.sh diff --git a/modules/jenkins/files/slave_scripts/lvm-kexec-reset.sh b/modules/openstack_project/files/slave_scripts/lvm-kexec-reset.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/lvm-kexec-reset.sh rename to modules/openstack_project/files/slave_scripts/lvm-kexec-reset.sh diff --git a/modules/jenkins/files/slave_scripts/markdown-docbook.sh b/modules/openstack_project/files/slave_scripts/markdown-docbook.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/markdown-docbook.sh rename to modules/openstack_project/files/slave_scripts/markdown-docbook.sh diff --git a/modules/jenkins/files/slave_scripts/mavencentral-upload.sh b/modules/openstack_project/files/slave_scripts/mavencentral-upload.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/mavencentral-upload.sh rename to modules/openstack_project/files/slave_scripts/mavencentral-upload.sh diff --git a/modules/jenkins/files/slave_scripts/merge_tags.sh b/modules/openstack_project/files/slave_scripts/merge_tags.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/merge_tags.sh rename to modules/openstack_project/files/slave_scripts/merge_tags.sh diff --git a/modules/jenkins/files/slave_scripts/package-gerrit.sh b/modules/openstack_project/files/slave_scripts/package-gerrit.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/package-gerrit.sh rename to modules/openstack_project/files/slave_scripts/package-gerrit.sh diff --git a/modules/jenkins/files/slave_scripts/php-laravel-build.sh b/modules/openstack_project/files/slave_scripts/php-laravel-build.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/php-laravel-build.sh rename to modules/openstack_project/files/slave_scripts/php-laravel-build.sh diff --git a/modules/jenkins/files/slave_scripts/ping.py b/modules/openstack_project/files/slave_scripts/ping.py similarity index 100% rename from modules/jenkins/files/slave_scripts/ping.py rename to modules/openstack_project/files/slave_scripts/ping.py diff --git a/modules/jenkins/files/slave_scripts/project-requirements-change.py b/modules/openstack_project/files/slave_scripts/project-requirements-change.py similarity index 100% rename from modules/jenkins/files/slave_scripts/project-requirements-change.py rename to modules/openstack_project/files/slave_scripts/project-requirements-change.py diff --git a/modules/jenkins/files/slave_scripts/propose_requirements_update.sh b/modules/openstack_project/files/slave_scripts/propose_requirements_update.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/propose_requirements_update.sh rename to modules/openstack_project/files/slave_scripts/propose_requirements_update.sh diff --git a/modules/jenkins/files/slave_scripts/propose_translation_update.sh b/modules/openstack_project/files/slave_scripts/propose_translation_update.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/propose_translation_update.sh rename to modules/openstack_project/files/slave_scripts/propose_translation_update.sh diff --git a/modules/jenkins/files/slave_scripts/propose_translation_update_horizon.sh b/modules/openstack_project/files/slave_scripts/propose_translation_update_horizon.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/propose_translation_update_horizon.sh rename to modules/openstack_project/files/slave_scripts/propose_translation_update_horizon.sh diff --git a/modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh b/modules/openstack_project/files/slave_scripts/propose_translation_update_manuals.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/propose_translation_update_manuals.sh rename to modules/openstack_project/files/slave_scripts/propose_translation_update_manuals.sh diff --git a/modules/jenkins/files/slave_scripts/pypi-extract-name.py b/modules/openstack_project/files/slave_scripts/pypi-extract-name.py similarity index 100% rename from modules/jenkins/files/slave_scripts/pypi-extract-name.py rename to modules/openstack_project/files/slave_scripts/pypi-extract-name.py diff --git a/modules/jenkins/files/slave_scripts/pypi-upload.sh b/modules/openstack_project/files/slave_scripts/pypi-upload.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/pypi-upload.sh rename to modules/openstack_project/files/slave_scripts/pypi-upload.sh diff --git a/modules/jenkins/files/slave_scripts/run-bash8.sh b/modules/openstack_project/files/slave_scripts/run-bash8.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-bash8.sh rename to modules/openstack_project/files/slave_scripts/run-bash8.sh diff --git a/modules/jenkins/files/slave_scripts/run-cover.sh b/modules/openstack_project/files/slave_scripts/run-cover.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-cover.sh rename to modules/openstack_project/files/slave_scripts/run-cover.sh diff --git a/modules/jenkins/files/slave_scripts/run-docs.sh b/modules/openstack_project/files/slave_scripts/run-docs.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-docs.sh rename to modules/openstack_project/files/slave_scripts/run-docs.sh diff --git a/modules/jenkins/files/slave_scripts/run-jsbuild.sh b/modules/openstack_project/files/slave_scripts/run-jsbuild.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-jsbuild.sh rename to modules/openstack_project/files/slave_scripts/run-jsbuild.sh diff --git a/modules/jenkins/files/slave_scripts/run-pep8.sh b/modules/openstack_project/files/slave_scripts/run-pep8.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-pep8.sh rename to modules/openstack_project/files/slave_scripts/run-pep8.sh diff --git a/modules/jenkins/files/slave_scripts/run-pylint.sh b/modules/openstack_project/files/slave_scripts/run-pylint.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-pylint.sh rename to modules/openstack_project/files/slave_scripts/run-pylint.sh diff --git a/modules/jenkins/files/slave_scripts/run-selenium.sh b/modules/openstack_project/files/slave_scripts/run-selenium.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-selenium.sh rename to modules/openstack_project/files/slave_scripts/run-selenium.sh diff --git a/modules/jenkins/files/slave_scripts/run-tarball.sh b/modules/openstack_project/files/slave_scripts/run-tarball.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-tarball.sh rename to modules/openstack_project/files/slave_scripts/run-tarball.sh diff --git a/modules/jenkins/files/slave_scripts/run-tox.sh b/modules/openstack_project/files/slave_scripts/run-tox.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-tox.sh rename to modules/openstack_project/files/slave_scripts/run-tox.sh diff --git a/modules/jenkins/files/slave_scripts/run-unittests.sh b/modules/openstack_project/files/slave_scripts/run-unittests.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-unittests.sh rename to modules/openstack_project/files/slave_scripts/run-unittests.sh diff --git a/modules/jenkins/files/slave_scripts/run-xmllint.sh b/modules/openstack_project/files/slave_scripts/run-xmllint.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/run-xmllint.sh rename to modules/openstack_project/files/slave_scripts/run-xmllint.sh diff --git a/modules/jenkins/files/slave_scripts/select-mirror.sh b/modules/openstack_project/files/slave_scripts/select-mirror.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/select-mirror.sh rename to modules/openstack_project/files/slave_scripts/select-mirror.sh diff --git a/modules/jenkins/files/slave_scripts/subunit2html.py b/modules/openstack_project/files/slave_scripts/subunit2html.py similarity index 100% rename from modules/jenkins/files/slave_scripts/subunit2html.py rename to modules/openstack_project/files/slave_scripts/subunit2html.py diff --git a/modules/jenkins/files/slave_scripts/tardiff.py b/modules/openstack_project/files/slave_scripts/tardiff.py similarity index 100% rename from modules/jenkins/files/slave_scripts/tardiff.py rename to modules/openstack_project/files/slave_scripts/tardiff.py diff --git a/modules/jenkins/files/slave_scripts/update-pip-cache.sh b/modules/openstack_project/files/slave_scripts/update-pip-cache.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/update-pip-cache.sh rename to modules/openstack_project/files/slave_scripts/update-pip-cache.sh diff --git a/modules/jenkins/files/slave_scripts/upstream_translation_horizon.sh b/modules/openstack_project/files/slave_scripts/upstream_translation_horizon.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/upstream_translation_horizon.sh rename to modules/openstack_project/files/slave_scripts/upstream_translation_horizon.sh diff --git a/modules/jenkins/files/slave_scripts/upstream_translation_update.sh b/modules/openstack_project/files/slave_scripts/upstream_translation_update.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/upstream_translation_update.sh rename to modules/openstack_project/files/slave_scripts/upstream_translation_update.sh diff --git a/modules/jenkins/files/slave_scripts/upstream_translation_update_manuals.sh b/modules/openstack_project/files/slave_scripts/upstream_translation_update_manuals.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/upstream_translation_update_manuals.sh rename to modules/openstack_project/files/slave_scripts/upstream_translation_update_manuals.sh diff --git a/modules/jenkins/files/slave_scripts/version-properties.sh b/modules/openstack_project/files/slave_scripts/version-properties.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/version-properties.sh rename to modules/openstack_project/files/slave_scripts/version-properties.sh diff --git a/modules/jenkins/files/slave_scripts/wait_for_nova.sh b/modules/openstack_project/files/slave_scripts/wait_for_nova.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/wait_for_nova.sh rename to modules/openstack_project/files/slave_scripts/wait_for_nova.sh diff --git a/modules/jenkins/files/slave_scripts/wait_for_puppet.sh b/modules/openstack_project/files/slave_scripts/wait_for_puppet.sh similarity index 100% rename from modules/jenkins/files/slave_scripts/wait_for_puppet.sh rename to modules/openstack_project/files/slave_scripts/wait_for_puppet.sh diff --git a/modules/jenkins/files/slave_scripts/zuul_swift_upload.py b/modules/openstack_project/files/slave_scripts/zuul_swift_upload.py similarity index 100% rename from modules/jenkins/files/slave_scripts/zuul_swift_upload.py rename to modules/openstack_project/files/slave_scripts/zuul_swift_upload.py diff --git a/modules/openstack_project/manifests/jenkins_params.pp b/modules/openstack_project/manifests/jenkins_params.pp new file mode 100644 index 0000000000..6dd043db5c --- /dev/null +++ b/modules/openstack_project/manifests/jenkins_params.pp @@ -0,0 +1,159 @@ +# Class: openstack_project::jenkins_params +# +# This class holds parameters that need to be +# accessed by other classes. +class openstack_project::jenkins_params { + case $::osfamily { + 'RedHat': { + #yum groupinstall "Development Tools" + # packages needed by slaves + $ant_package = 'ant' + $awk_package = 'gawk' + $asciidoc_package = 'asciidoc' + $curl_package = 'curl' + $docbook_xml_package = 'docbook-style-xsl' + $docbook5_xml_package = 'docbook5-schemas' + $docbook5_xsl_package = 'docbook5-style-xsl' + $firefox_package = 'firefox' + $graphviz_package = 'graphviz' + $mod_wsgi_package = 'mod_wsgi' + $libcurl_dev_package = 'libcurl-devel' + $ldap_dev_package = 'openldap-devel' + $librrd_dev_package = 'rrdtool-devel' + # packages needed by document translation + $gnome_doc_package = 'gnome-doc-utils' + $libtidy_package = 'libtidy' + $gettext_package = 'gettext' + $language_fonts_packages = [] + # for keystone ldap auth integration + $libsasl_dev = 'cyrus-sasl-devel' + $nspr_dev_package = 'nspr-devel' + $sqlite_dev_package = 'sqlite-devel' + $libvirt_dev_package = 'libvirt-devel' + $libxml2_package = 'libxml2' + $libxml2_dev_package = 'libxml2-devel' + $libxslt_dev_package = 'libxslt-devel' + $libffi_dev_package = 'libffi-devel' + # FIXME: No Maven packages on RHEL + #$maven_package = 'maven' + # For tooz unit tests + $memcached_package = 'memcached' + # For Ceilometer unit tests + $mongodb_package = 'mongodb-server' + $pandoc_package = 'pandoc' + $pkgconfig_package = 'pkgconfig' + $python_libvirt_package = 'libvirt-python' + $python_lxml_package = 'python-lxml' + $python_magic_package = 'python-magic' + $python_requests_package = 'python-requests' + $python_zmq_package = 'python-zmq' + $rubygems_package = 'rubygems' + # Common Lisp interpreter, used for cl-openstack-client + $sbcl_package = 'sbcl' + $sqlite_package = 'sqlite' + $unzip_package = 'unzip' + $zip_package = 'zip' + $xslt_package = 'libxslt' + $xvfb_package = 'xorg-x11-server-Xvfb' + # PHP package, used for community portal + $php5_cli_package = 'php-cli' + # FIXME: No zookeeper packages on RHEL + #$zookeeper_package = 'zookeeper-server' + $cgroups_package = 'libcgroup' + if ($::operatingsystem == 'Fedora') and ($::operatingsystemrelease >= 19) { + # From Fedora 19 and onwards there's no longer + # support to mysql-devel. + # Only community-mysql-devel. If you try to + # install mysql-devel you get a conflict with + # mariadb packages. + $mysql_dev_package = 'community-mysql-devel' + $cgroups_tools_package = 'libcgroup-tools' + $cgconfig_require = [ + Package['cgroups'], + Package['cgroups-tools'], + ] + $cgred_require = [ + Package['cgroups'], + Package['cgroups-tools'], + ] + } else { + $mysql_dev_package = 'mysql-devel' + $cgroups_tools_package = '' + $cgconfig_require = Package['cgroups'] + $cgred_require = Package['cgroups'] + } + } + 'Debian': { + # packages needed by slaves + $ant_package = 'ant' + $awk_package = 'gawk' + $asciidoc_package = 'asciidoc' + $curl_package = 'curl' + $docbook_xml_package = 'docbook-xml' + $docbook5_xml_package = 'docbook5-xml' + $docbook5_xsl_package = 'docbook-xsl' + $firefox_package = 'firefox' + $graphviz_package = 'graphviz' + $mod_wsgi_package = 'libapache2-mod-wsgi' + $libcurl_dev_package = 'libcurl4-gnutls-dev' + $ldap_dev_package = 'libldap2-dev' + $librrd_dev_package = 'librrd-dev' + # packages needed by document translation + $gnome_doc_package = 'gnome-doc-utils' + $libtidy_package = 'libtidy-0.99-0' + $gettext_package = 'gettext' + $language_fonts_packages = ['fonts-takao', 'fonts-nanum'] + # for keystone ldap auth integration + $libsasl_dev = 'libsasl2-dev' + $mysql_dev_package = 'libmysqlclient-dev' + $nspr_dev_package = 'libnspr4-dev' + $sqlite_dev_package = 'libsqlite3-dev' + $libvirt_dev_package = 'libvirt-dev' + $libxml2_package = 'libxml2-utils' + $libxml2_dev_package = 'libxml2-dev' + $libxslt_dev_package = 'libxslt1-dev' + $libffi_dev_package = 'libffi-dev' + $maven_package = 'maven2' + # For tooz unit tests + $memcached_package = 'memcached' + # For Ceilometer unit tests + $mongodb_package = 'mongodb' + $pandoc_package = 'pandoc' + $pkgconfig_package = 'pkg-config' + $python_libvirt_package = 'python-libvirt' + $python_lxml_package = 'python-lxml' + $python_magic_package = 'python-magic' + $python_requests_package = 'python-requests' + $python_zmq_package = 'python-zmq' + $rubygems_package = 'rubygems' + $ruby1_9_1_package = 'ruby1.9.1' + $ruby1_9_1_dev_package = 'ruby1.9.1-dev' + $ruby_bundler_package = 'ruby-bundler' + # Common Lisp interpreter, used for cl-openstack-client + $sbcl_package = 'sbcl' + $sqlite_package = 'sqlite3' + $unzip_package = 'unzip' + $zip_package = 'zip' + $xslt_package = 'xsltproc' + $xvfb_package = 'xvfb' + # PHP package, used for community portal + $php5_cli_package = 'php5-cli' + $php5_mcrypt_package = 'php5-mcrypt' + # For [tooz, taskflow, nova] using zookeeper in unit tests + $zookeeper_package = 'zookeeperd' + $cgroups_package = 'cgroup-bin' + $cgroups_tools_package = '' + $cgconfig_require = [ + Package['cgroups'], + File['/etc/init/cgconfig.conf'], + ] + $cgred_require = [ + Package['cgroups'], + File['/etc/init/cgred.conf'], + ] + } + default: { + fail("Unsupported osfamily: ${::osfamily} The 'jenkins' module only supports osfamily Debian or RedHat (slaves only).") + } + } +} diff --git a/modules/openstack_project/manifests/bare_slave.pp b/modules/openstack_project/manifests/simple_slave.pp similarity index 92% rename from modules/openstack_project/manifests/bare_slave.pp rename to modules/openstack_project/manifests/simple_slave.pp index cce04171c1..49922b0957 100644 --- a/modules/openstack_project/manifests/bare_slave.pp +++ b/modules/openstack_project/manifests/simple_slave.pp @@ -2,7 +2,7 @@ # similar to an OpenStack Jenkins slave but does not need to # have services managed like firewall, ntp, automatic upgrades, # and so on. -class openstack_project::bare_slave( +class openstack_project::simple_slave( $certname = $::fqdn, $install_users = true ) { diff --git a/modules/openstack_project/manifests/single_use_slave.pp b/modules/openstack_project/manifests/single_use_slave.pp index c2e3be5d4f..aec27e58ed 100644 --- a/modules/openstack_project/manifests/single_use_slave.pp +++ b/modules/openstack_project/manifests/single_use_slave.pp @@ -10,7 +10,7 @@ class openstack_project::single_use_slave ( $certname = $::fqdn, $install_users = true, $sudo = false, - $bare = true, + $thin = true, $python3 = false, $include_pypy = false, $automatic_upgrades = false, @@ -37,9 +37,17 @@ class openstack_project::single_use_slave ( class { 'jenkins::slave': ssh_key => $ssh_key, sudo => $sudo, - bare => $bare, python3 => $python3, - include_pypy => $include_pypy, - all_mysql_privs => $all_mysql_privs, } + + class { 'openstack_project::slave_common': + include_pypy => $include_pypy, + } + + if (! $thin) { + class { 'openstack_project::thick_slave': + all_mysql_privs => $all_mysql_privs, + } + } + } diff --git a/modules/openstack_project/manifests/slave.pp b/modules/openstack_project/manifests/slave.pp index b77fed8b41..6365f9b6d8 100644 --- a/modules/openstack_project/manifests/slave.pp +++ b/modules/openstack_project/manifests/slave.pp @@ -1,32 +1,36 @@ # == Class: openstack_project::slave # class openstack_project::slave ( - $bare = false, + $thin = false, $certname = $::fqdn, $ssh_key = '', $sysadmins = [], $python3 = false, $include_pypy = false ) { + include openstack_project include openstack_project::tmpcleanup + class { 'openstack_project::automatic_upgrades': origins => ['LP-PPA-saltstack-salt precise'], } + class { 'openstack_project::server': iptables_public_tcp_ports => [], certname => $certname, sysadmins => $sysadmins, } + class { 'jenkins::slave': - bare => $bare, ssh_key => $ssh_key, python3 => $python3, - include_pypy => $include_pypy, } + class { 'salt': salt_master => 'ci-puppetmaster.openstack.org', } + include jenkins::cgroups include ulimit ulimit::conf { 'limit_jenkins_procs': @@ -35,4 +39,13 @@ class openstack_project::slave ( limit_item => 'nproc', limit_value => '256' } + + class { 'openstack_project::slave_common': + include_pypy => $include_pypy, + } + + if (! $thin) { + include openstack_project::thick_slave + } + } diff --git a/modules/openstack_project/manifests/slave_common.pp b/modules/openstack_project/manifests/slave_common.pp new file mode 100644 index 0000000000..dc7bc8185a --- /dev/null +++ b/modules/openstack_project/manifests/slave_common.pp @@ -0,0 +1,58 @@ +# == Class: openstack_project::slave_common +# +# Common configuration between openstack_project::slave and +# openstack_project::single_use_slave +class openstack_project::slave_common( + $include_pypy = false, +){ + vcsrepo { '/opt/requirements': + ensure => latest, + provider => git, + revision => 'master', + source => 'https://git.openstack.org/openstack/requirements', + } + + file { '/usr/local/jenkins/slave_scripts': + ensure => directory, + owner => 'root', + group => 'root', + mode => '0755', + recurse => true, + purge => true, + force => true, + require => File['/usr/local/jenkins'], + source => 'puppet:///modules/openstack_project/slave_scripts', + } + + # Temporary for debugging glance launch problem + # https://lists.launchpad.net/openstack/msg13381.html + # NOTE(dprince): ubuntu only as RHEL6 doesn't have sysctl.d yet + if ($::osfamily == 'Debian') { + + file { '/etc/sysctl.d/10-ptrace.conf': + ensure => present, + source => 'puppet:///modules/jenkins/10-ptrace.conf', + owner => 'root', + group => 'root', + mode => '0444', + } + + exec { 'ptrace sysctl': + subscribe => File['/etc/sysctl.d/10-ptrace.conf'], + refreshonly => true, + command => '/sbin/sysctl -p /etc/sysctl.d/10-ptrace.conf', + } + + if $include_pypy { + apt::ppa { 'ppa:pypy/ppa': } + package { 'pypy': + ensure => present, + require => Apt::Ppa['ppa:pypy/ppa'] + } + package { 'pypy-dev': + ensure => present, + require => Apt::Ppa['ppa:pypy/ppa'] + } + } + } +} diff --git a/modules/openstack_project/manifests/thick_slave.pp b/modules/openstack_project/manifests/thick_slave.pp new file mode 100644 index 0000000000..aee195408d --- /dev/null +++ b/modules/openstack_project/manifests/thick_slave.pp @@ -0,0 +1,217 @@ +# Extra configuration (like mysql) that we will want on many but not all +# slaves. +class openstack_project::thick_slave( + $all_mysql_privs = false, +){ + + include openstack_project::jenkins_params + + # Packages that most jenkins slaves (eg, unit test runners) need + $packages = [ + $::openstack_project::jenkins_params::ant_package, # for building buck + $::openstack_project::jenkins_params::awk_package, # for building extract_docs.awk to work correctly + $::openstack_project::jenkins_params::asciidoc_package, # for building gerrit/building openstack docs + $::openstack_project::jenkins_params::curl_package, + $::openstack_project::jenkins_params::docbook_xml_package, # for building openstack docs + $::openstack_project::jenkins_params::docbook5_xml_package, # for building openstack docs + $::openstack_project::jenkins_params::docbook5_xsl_package, # for building openstack docs + $::openstack_project::jenkins_params::gettext_package, # for msgfmt, used in translating manuals + $::openstack_project::jenkins_params::gnome_doc_package, # for generating translation files for docs + $::openstack_project::jenkins_params::graphviz_package, # for generating graphs in docs + $::openstack_project::jenkins_params::firefox_package, # for selenium tests + $::openstack_project::jenkins_params::mod_wsgi_package, + $::openstack_project::jenkins_params::language_fonts_packages, + $::openstack_project::jenkins_params::libcurl_dev_package, + $::openstack_project::jenkins_params::ldap_dev_package, + $::openstack_project::jenkins_params::librrd_dev_package, # for python-rrdtool, used by kwapi + $::openstack_project::jenkins_params::libtidy_package, # for python-tidy, used by sphinxcontrib-docbookrestapi + $::openstack_project::jenkins_params::libsasl_dev, # for keystone ldap auth integration + $::openstack_project::jenkins_params::memcached_package, # for tooz unit tests + $::openstack_project::jenkins_params::mongodb_package, # for ceilometer unit tests + $::openstack_project::jenkins_params::mysql_dev_package, + $::openstack_project::jenkins_params::nspr_dev_package, # for spidermonkey, used by ceilometer + $::openstack_project::jenkins_params::sqlite_dev_package, + $::openstack_project::jenkins_params::libvirt_dev_package, + $::openstack_project::jenkins_params::libxml2_package, + $::openstack_project::jenkins_params::libxml2_dev_package, # for xmllint, need for wadl + $::openstack_project::jenkins_params::libxslt_dev_package, + $::openstack_project::jenkins_params::libffi_dev_package, # xattr's cffi dependency + $::openstack_project::jenkins_params::pandoc_package, #for docs, markdown->docbook, bug 924507 + $::openstack_project::jenkins_params::pkgconfig_package, # for spidermonkey, used by ceilometer + $::openstack_project::jenkins_params::python_libvirt_package, + $::openstack_project::jenkins_params::python_lxml_package, # for validating openstack manuals + $::openstack_project::jenkins_params::python_magic_package, # for pushing files to swift + $::openstack_project::jenkins_params::python_requests_package, # for pushing files to swift + $::openstack_project::jenkins_params::python_zmq_package, # zeromq unittests (not pip installable) + $::openstack_project::jenkins_params::rubygems_package, + $::openstack_project::jenkins_params::sbcl_package, # cl-openstack-client testing + $::openstack_project::jenkins_params::sqlite_package, + $::openstack_project::jenkins_params::unzip_package, + $::openstack_project::jenkins_params::zip_package, + $::openstack_project::jenkins_params::xslt_package, # for building openstack docs + $::openstack_project::jenkins_params::xvfb_package, # for selenium tests + $::openstack_project::jenkins_params::php5_cli_package, # for community portal build + ] + + package { $packages: + ensure => present, + } + + package { 'rake': + ensure => '10.1.1', + provider => gem, + before => Package['puppetlabs_spec_helper'], + require => Package['rubygems'], + } + + $gem_packages = [ + 'bundler', + 'puppet-lint', + 'puppetlabs_spec_helper', + ] + + package { $gem_packages: + ensure => latest, + provider => gem, + require => Package['rubygems'], + } + + if ($::operatingsystem == 'Fedora') and ($::operatingsystemrelease >= 19) { + class {'mysql::server': + config_hash => { + 'root_password' => 'insecure_slave', + 'default_engine' => 'MyISAM', + 'bind_address' => '127.0.0.1', + }, + package_name => 'community-mysql-server', + } + } else { + class {'mysql::server': + config_hash => { + 'root_password' => 'insecure_slave', + 'default_engine' => 'MyISAM', + 'bind_address' => '127.0.0.1', + } + } + } + + include mysql::server::account_security + + mysql::db { 'openstack_citest': + user => 'openstack_citest', + password => 'openstack_citest', + host => 'localhost', + grant => ['all'], + require => [ + Class['mysql::server'], + Class['mysql::server::account_security'], + ], + } + + # mysql::db is too dumb to realize that the same user can have + # access to multiple databases and will fail if you try creating + # a second DB with the same user. Create the DB directly as mysql::db + # above is creating the user for us. + database { 'openstack_baremetal_citest': + ensure => present, + charset => 'utf8', + provider => 'mysql', + require => [ + Class['mysql::server'], + Class['mysql::server::account_security'], + ], + } + + database_grant { 'openstack_citest@localhost/openstack_baremetal_citest': + privileges => ['all'], + provider => 'mysql', + require => Database_user['openstack_citest@localhost'], + } + + if ($all_mysql_privs == true) { + database_grant { 'openstack_citest@localhost': + privileges => ['all'], + provider => 'mysql', + require => Database_user['openstack_citest@localhost'], + } + } + + # The puppetlabs postgres module does not manage the postgres user + # and group for us. Create them here to ensure concat can create + # dirs and files owned by this user and group. + user { 'postgres': + ensure => present, + gid => 'postgres', + system => true, + require => Group['postgres'], + } + + group { 'postgres': + ensure => present, + system => true, + } + + class { 'postgresql::server': + postgres_password => 'insecure_slave', + manage_firewall => false, + # The puppetlabs postgres module incorrectly quotes ip addresses + # in the postgres server config. Use localhost instead. + listen_addresses => ['localhost'], + require => [ + User['postgres'], + Class['postgresql::params'], + ], + } + + class { 'postgresql::lib::devel': + require => Class['postgresql::params'], + } + + # Create DB user and explicitly make it non superuser + # that can create databases. + postgresql::server::role { 'openstack_citest': + password_hash => postgresql_password('openstack_citest', 'openstack_citest'), + createdb => true, + superuser => false, + require => Class['postgresql::server'], + } + + postgresql::server::db { 'openstack_citest': + user => 'openstack_citest', + password => postgresql_password('openstack_citest', 'openstack_citest'), + grant => 'all', + require => [ + Class['postgresql::server'], + Postgresql::Server::Role['openstack_citest'], + ], + } + + # Alter the new database giving the test DB user ownership of the DB. + # This is necessary to make the nova unittests run properly. + postgresql_psql { 'ALTER DATABASE openstack_citest OWNER TO openstack_citest': + db => 'postgres', + refreshonly => true, + subscribe => Postgresql::Server::Db['openstack_citest'], + } + + postgresql::server::db { 'openstack_baremetal_citest': + user => 'openstack_citest', + password => postgresql_password('openstack_citest', 'openstack_citest'), + grant => 'all', + require => [ + Class['postgresql::server'], + Postgresql::Server::Role['openstack_citest'], + ], + } + + # Alter the new database giving the test DB user ownership of the DB. + # This is necessary to make the nova unittests run properly. + postgresql_psql { 'ALTER DATABASE openstack_baremetal_citest OWNER TO + openstack_citest': + db => 'postgres', + refreshonly => true, + subscribe => Postgresql::Server::Db['openstack_baremetal_citest'], + } + +} +# vim:sw=2:ts=2:expandtab:textwidth=79