From 4a130afba58836ebb2f70a31c88588ea46017009 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Fri, 14 Apr 2017 13:05:03 -0400 Subject: Bug 1328874 - Add Vagrantfile for production-like development VMs --- .gitignore | 1 + README | 95 ----- README.rst | 77 ++++ Vagrantfile | 98 +++++ scripts/bugzilla-queue.rhel | 2 +- vagrant_support/apache.j2 | 21 ++ vagrant_support/apache.yml | 12 + vagrant_support/bashrc | 11 + vagrant_support/bmo-configured | 39 ++ vagrant_support/bmo-reconfigure.j2 | 7 + vagrant_support/bmo-refresh-bundle.j2 | 3 + vagrant_support/bugzilla-push | 112 ++++++ vagrant_support/checksetup.yml | 32 ++ vagrant_support/checksetup_answers.j2 | 37 ++ vagrant_support/cron.yml | 45 +++ vagrant_support/devtools.yml | 4 + vagrant_support/dovecot.j2 | 15 + vagrant_support/email.yml | 32 ++ vagrant_support/jobqueue.yml | 21 ++ vagrant_support/memcached.yml | 10 + vagrant_support/my.cnf | 46 +++ vagrant_support/playbook.yml | 176 +++++++++ vagrant_support/postfix/main.cf | 678 ++++++++++++++++++++++++++++++++++ vagrant_support/postfix/virtual | 1 + vagrant_support/push.yml | 15 + vagrant_support/timezone.yml | 18 + 26 files changed, 1512 insertions(+), 96 deletions(-) delete mode 100644 README create mode 100644 README.rst create mode 100644 Vagrantfile create mode 100644 vagrant_support/apache.j2 create mode 100644 vagrant_support/apache.yml create mode 100644 vagrant_support/bashrc create mode 100755 vagrant_support/bmo-configured create mode 100755 vagrant_support/bmo-reconfigure.j2 create mode 100755 vagrant_support/bmo-refresh-bundle.j2 create mode 100755 vagrant_support/bugzilla-push create mode 100644 vagrant_support/checksetup.yml create mode 100644 vagrant_support/checksetup_answers.j2 create mode 100644 vagrant_support/cron.yml create mode 100644 vagrant_support/devtools.yml create mode 100644 vagrant_support/dovecot.j2 create mode 100644 vagrant_support/email.yml create mode 100644 vagrant_support/jobqueue.yml create mode 100644 vagrant_support/memcached.yml create mode 100644 vagrant_support/my.cnf create mode 100644 vagrant_support/playbook.yml create mode 100644 vagrant_support/postfix/main.cf create mode 100644 vagrant_support/postfix/virtual create mode 100644 vagrant_support/push.yml create mode 100644 vagrant_support/timezone.yml diff --git a/.gitignore b/.gitignore index 0172ea059..22a62f4ad 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ /blib /Bugzilla-*.*/ /local +.vagrant/ /skins/contrib/Dusk/admin.css /skins/contrib/Dusk/bug.css diff --git a/README b/README deleted file mode 100644 index 05ab75447..000000000 --- a/README +++ /dev/null @@ -1,95 +0,0 @@ -What is Bugzilla? -================= -Bugzilla is a free bug-tracking system that is developed by an active -community of volunteers in the Mozilla community. You can install and -use it without having to pay any license fee. - -Minimum requirements -==================== -It can be installed on Windows, Mac OS X, Linux and other Unix flavors. -Bugzilla is written in Perl, meaning that Perl must be installed on your system. -You will also need a web server as well as a DB server (see below). - -Installation & Upgrading -======================== -The documentation to install, upgrade, configure and use Bugzilla can be found -in different formats: -* docs/en/html/Bugzilla-Guide.html (HTML version) -* docs/en/txt/Bugzilla-Guide.txt (text version) -* docs/en/pdf/Bugzilla-Guide.pdf (PDF version) - -If the documentation is missing, you can get it online by visiting -http://www.bugzilla.org/docs/ from where you can select the documentation -corresponding to the Bugzilla version you are installing. - -Bugzilla Quick Start Guide -========================== -(or, how to get Bugzilla up and running in 10 steps) -Christian Reis - -This express installation guide is for "normal" Bugzilla installations, -which means a Linux or Unix system on which Apache, Perl, MySQL or PostgreSQL -and a Sendmail compatible MTA are available. For other configurations, please -see the "Installing Bugzilla" section of the Bugzilla Guide in the docs/ directory. - -1. Decide from which URL and directory under your webserver root you - will be serving the Bugzilla webpages. - -2. Unpack the distribution into the chosen directory (there is no copying or - installation involved). - -3. Run ./checksetup.pl, look for unsolved requirements, and install them. - You can run checksetup as many times as necessary to check if - everything required has been installed. - - These will usually include assorted Perl modules, MySQL or PostgreSQL, - and a MTA. - - After a successful dependency check, checksetup should complain that - localconfig needs to be edited. - -4. Edit the localconfig file, in particular the $webservergroup and - $db_* variables. In particular, $db_name and $db_user will define - your database setup in step 5. - -5. Create a user permission for the name supplied as $db_user with - read/write access to the database whose name is given by $db_name. - - If you are not familiar with MySQL permissions, it's a good idea to - use the mysql_setpermission script that is installed with the MySQL - distribution, and be sure to read Bugzilla Security - MySQL section - in the Bugzilla Guide or PostgreSQL documentation. - -6. Run checksetup.pl once more; if all goes well, it should set up the - Bugzilla database for you. If not, return to step 5. - - checksetup.pl should ask you, this time, for the administrator's - email address and password. These will be used for the initial - Bugzilla administrator account. - -7. Configure Apache (or install and configure, if you don't have it up - yet) to point to the Bugzilla directory. You can choose between - mod_cgi and mod_perl. The Bugzilla documentation has detailed information - for both modes. - -8. Visit the URL you chose for Bugzilla. Your browser should display the - default Bugzilla home page. You should then log in as the - administrator by following the "Log in" link and supplying the - account information you provided in step 6. - -9. Visit the "Parameters" page, as suggested by the page displayed to you. - Set up the relevant parameters for your local setup. - -10. That's it. If anything unexpected comes up: - - - read the error message carefully, - - backtrack through the steps above, - - check the official installation guide. - -Support and installation questions should be directed to the -support-bugzilla@lists.mozilla.org mailing list. - -Further support information is at http://www.bugzilla.org/support/ - - -Fubar is cool diff --git a/README.rst b/README.rst new file mode 100644 index 000000000..8eb5d1761 --- /dev/null +++ b/README.rst @@ -0,0 +1,77 @@ +========================= +BMO: bugzilla.mozilla.org +========================= + +BMO is a Mozilla's highly customized version of Bugzilla. + +If you are looking to run bugzilla, you should see https://github.com/bugzilla/bugzilla. + +If you want to contribute to BMO, you can fork this repo and get a local copy +of BMO running in a few minutes. + +Install Vagrant +=============== + +You will need to install the following software: + +* Vagrant 1.9.1 or later + +Doing this on OSX can be accomplished with homebrew: + +.. code-block:: bash + + brew install vagrant + +For Ubuntu 16.04: +download the vagrant .dpkg directly from https://vagrantup.com, +the one that ships with Ubuntu is too old. + +Setup Vagrant VMs +================= + +From your BMO checkout run the following command + +.. code-block:: bash + + vagrant up + +Depending on your machine, this will take a few minutes to much longer +depending on your internet connection speed and the speed of your computer. + +If this fails, please file a bug `using this link `__ + +Otherwise, you should have a working bmo developer machine setup! + +To test it, you'll want to add an entry to /etc/hosts +for bmo-web.vm pointing to 192.168.3.43 + +After that, you should be able to visit http://bmo-web.vm/ from your browser. +You can login as vagrant@bmo-web.vm with the password "vagrant01!" (without quotes). + +Making Changes and Seeing them +============================== + +After editing files in the bmo directory, you will need to run + +.. code-block:: bash + + vagrant rsync && vagrant provision web + +to see the changes applied to your vagrant VM. + +Technical Details +================= + +This is a very complete but scaled-down version of production BMO. It is using +roughly the same RPMS (centos 6 vs. EL 6 in production) and the same perl +dependencies (via https://github.com/mozilla-bteam/carton-bundles). + +It includes most of the products, groups, and users too (with the users having +their password reset as mentioned above). Email is disabled for all users, +however it is safe to enable email as the box is configured to send all email +to the 'vagrant' user on the web vm. + +Most of the cron jobs and the jobqueue daemon are running. The push connector +is not currently configured, nor is it configured to talk to Pulse. + +It is configured to use memcached as well. diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..88c68d052 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,98 @@ +# vim: set ft=ruby sw=2 ts=2: +# -*- mode: ruby -*- + +DB_IP = ENV.fetch "BMO_DB_IP", '192.168.3.42' +WEB_IP = ENV.fetch "BMO_WEB_IP", '192.168.3.43' +DB_HOSTNAME = ENV.fetch "BMO_DB_HOST", 'bmo-db.vm' +WEB_HOSTNAME = ENV.fetch "BMO_WEB_HOST", 'bmo-web.vm' +DB_PORT = ENV.fetch "BMO_DB_PORT", 2221 +WEB_PORT = ENV.fetch "BMO_WEB_PORT", 2222 +WEB_MEM = ENV.fetch "BMO_WEB_MEM", 2048 +WEB_CPU = ENV.fetch "BMO_WEB_CPU", 2 + +# this is for centos 6 / el 6 +VENDOR_BUNDLE_URL = ENV.fetch "BMO_BUNDLE_URL", + 'https://moz-devservices-bmocartons.s3.amazonaws.com/bmo/vendor.tar.gz' + +# All Vagrant configuration is done below. The '2' in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure('2') do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + config.vm.provision 'ansible_local', run: 'always' do |ansible| + ansible.playbook = 'vagrant_support/playbook.yml' + ansible.extra_vars = { + WEB_IP: WEB_IP, + DB_IP: DB_IP, + WEB_HOSTNAME: WEB_HOSTNAME, + DB_HOSTNAME: DB_HOSTNAME, + VENDOR_BUNDLE_URL: VENDOR_BUNDLE_URL, + } + end + + config.vm.define 'db' do |db| + db.vm.box = 'centos/6' + + db.vm.hostname = DB_HOSTNAME + db.vm.network 'private_network', ip: DB_IP + db.vm.network 'forwarded_port', + id: 'ssh', + host: DB_PORT, + guest: 22, + auto_correct: true + + db.vm.synced_folder '.', '/vagrant', type: 'rsync', + rsync__args: ['--verbose', '--archive', '--delete', '-z', '--copy-links', + '--exclude=local/', + '--exclude=data/', + '--exclude=template_cache/', + '--exclude=localconfig'] + db.vm.provider 'parallels' do |prl, override| + override.vm.box = 'parallels/centos-6.8' + end + end + + config.vm.define 'web', primary: true do |web| + # Every Vagrant development environment requires a box. You can search for + # boxes at https://atlas.hashicorp.com/search. + web.vm.box = 'centos/6' + web.vm.hostname = WEB_HOSTNAME + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + web.vm.network 'private_network', ip: WEB_IP + web.vm.network 'forwarded_port', + id: 'ssh', + host: WEB_PORT, + guest: 22, + auto_correct: true + + + web.vm.synced_folder '.', '/vagrant', type: 'rsync', + rsync__args: ['--verbose', '--archive', '--delete', '-z', '--copy-links', + '--exclude=local/', + '--exclude=data/', + '--exclude=template_cache/', + '--exclude=localconfig'] + + web.vm.provider 'virtualbox' do |v| + v.memory = WEB_MEM + v.cpus = WEB_CPU + end + + web.vm.provider 'parallels' do |prl, override| + override.vm.box = 'parallels/centos-6.8' + prl.memory = WEB_MEM + prl.cpus = WEB_CPU + end + + web.vm.provider 'vmware_fusion' do |v| + v.vmx['memsize'] = WEB_MEM + v.vmx['numvcpus'] = WEB_CPU + end + end +end diff --git a/scripts/bugzilla-queue.rhel b/scripts/bugzilla-queue.rhel index dd7a2c664..083686828 100755 --- a/scripts/bugzilla-queue.rhel +++ b/scripts/bugzilla-queue.rhel @@ -75,7 +75,7 @@ start () touch $PIDFILE chown $USER $PIDFILE daemon --user=$USER \ - "$BIN ${OPTIONS} -p '$PIDFILE' -n $NAME start > /dev/null" + "cd $BUGZILLA && $BIN ${OPTIONS} -p '$PIDFILE' -n $NAME start > /dev/null" ret=$? [ $ret -eq "0" ] && touch /var/lock/subsys/$NAME echo diff --git a/vagrant_support/apache.j2 b/vagrant_support/apache.j2 new file mode 100644 index 000000000..1de3d8faa --- /dev/null +++ b/vagrant_support/apache.j2 @@ -0,0 +1,21 @@ +PerlSwitches -wT +PerlConfigRequire /vagrant/mod_perl.pl + + + StartServers 2 + MinSpareServers 2 + MaxSpareServers 2 + MaxClients 200 + MaxRequestsPerChild 4500 + + + + KeepAlive Off + DocumentRoot "/vagrant" + + DirectoryIndex index.cgi + Options Indexes FollowSymLinks ExecCGI + AllowOverride All + Allow from all + + diff --git a/vagrant_support/apache.yml b/vagrant_support/apache.yml new file mode 100644 index 000000000..e4399f612 --- /dev/null +++ b/vagrant_support/apache.yml @@ -0,0 +1,12 @@ +--- +- name: configure httpd + template: + src: apache.j2 + dest: /etc/httpd/conf.d/bugzilla.conf + mode: 0644 + +- name: enable httpd + service: name=httpd enabled=yes + +- name: restart httpd + service: name=httpd state=restarted diff --git a/vagrant_support/bashrc b/vagrant_support/bashrc new file mode 100644 index 000000000..e9764c7f2 --- /dev/null +++ b/vagrant_support/bashrc @@ -0,0 +1,11 @@ +# .bashrc + +# Source global definitions +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi + +# User specific aliases and functions +PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] $ ' + +cd /vagrant diff --git a/vagrant_support/bmo-configured b/vagrant_support/bmo-configured new file mode 100755 index 000000000..4d421577b --- /dev/null +++ b/vagrant_support/bmo-configured @@ -0,0 +1,39 @@ +#!/bin/bash + +if [[ ! -f /vagrant/localconfig ]]; then + echo "missing localconfig" + exit 1 +fi + +if [[ ! -f /vagrant/data/params ]]; then + echo "missing data/params" + exit 1 +fi + +if grep -q "'urlbase' => ''" /vagrant/data/params; then + echo "urlbase not configured" + exit 1; +fi + +if grep -q '$db_host.*localhost' /vagrant/localconfig; then + echo "\$db_host not configured" + exit 1 +fi + +for file in /vagrant/data/params /vagrant/index.cgi; do + info="$(stat -c %U.%G "$file")" + + if [[ $info != "vagrant.apache" ]]; then + echo "wrong file owner: $info $file" + exit 1 + fi +done + +cd /vagrant +sudo -u apache perl -T index.cgi &>/tmp/index.html || exit 1 + +grep -q skin-Dusk /tmp/index.html && exit 1 + +rm /tmp/index.html + +exit 0 diff --git a/vagrant_support/bmo-reconfigure.j2 b/vagrant_support/bmo-reconfigure.j2 new file mode 100755 index 000000000..77a9d2465 --- /dev/null +++ b/vagrant_support/bmo-reconfigure.j2 @@ -0,0 +1,7 @@ +#!/bin/bash + +cd /vagrant +rm localconfig data/params +perl checksetup.pl /home/vagrant/checksetup_answers.txt +perl checksetup.pl /home/vagrant/checksetup_answers.txt +perl scripts/generate_bmo_data.pl 'vagrant@{{ WEB_HOSTNAME }}' diff --git a/vagrant_support/bmo-refresh-bundle.j2 b/vagrant_support/bmo-refresh-bundle.j2 new file mode 100755 index 000000000..6981d9eb7 --- /dev/null +++ b/vagrant_support/bmo-refresh-bundle.j2 @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -q -L '{{VENDOR_BUNDLE_URL}}' | sudo tar -zxf - -C /opt diff --git a/vagrant_support/bugzilla-push b/vagrant_support/bugzilla-push new file mode 100755 index 000000000..995b0d44c --- /dev/null +++ b/vagrant_support/bugzilla-push @@ -0,0 +1,112 @@ +#!/bin/bash +# +# bugzilla-push This starts, stops, and restarts the Bugzilla push +# daemon, which manages syncronising bugzilla.mozilla.org and +# third party bugzilla installs. +# +# chkconfig: 345 85 15 +# description: Bugzilla push daemon +# +### BEGIN INIT INFO +# Provides: bugzilla-push +# Required-Start: $local_fs $syslog MTA mysqld +# Required-Stop: $local_fs $syslog MTA mysqld +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Start and stop the Bugzilla push daemon. +# Description: The Bugzilla push daemon (bugzilla-pushd.pl) +# +# +# +### END INIT INFO + +NAME=`basename $0` + +################# +# Configuration # +################# + +# This should be the path to your Bugzilla +BUGZILLA=/data/www/bugzilla.mozilla.org +# Who owns the Bugzilla directory and files? +USER=root + +# If you want to pass any options to the daemon (like -d for debugging) +# specify it here. +OPTIONS="" + +# You can also override the configuration by creating a +# /etc/sysconfig/bugzilla-queue file so that you don't +# have to edit this script. +if [ -r /etc/sysconfig/$NAME ]; then + . /etc/sysconfig/$NAME +fi + +########## +# Script # +########## + +RETVAL=0 +BIN=$BUGZILLA/extensions/Push/bin/bugzilla-pushd.pl +PIDFILE=/var/run/$NAME.pid + +# Source function library. +. /etc/rc.d/init.d/functions + +usage () +{ + echo "Usage: service $NAME {start|stop|status|restart|condrestart}" + RETVAL=1 +} + + +start () +{ + if [ -f "$PIDFILE" ]; then + checkpid `cat $PIDFILE` && return 0 + fi + echo -n "Starting $NAME: " + touch $PIDFILE + chown $USER $PIDFILE + daemon --user=$USER "cd $BUGZILLA && $BIN ${OPTIONS} -p '$PIDFILE' -n $NAME start > /dev/null" + ret=$? + [ $ret -eq "0" ] && touch /var/lock/subsys/$NAME + echo + return $ret +} + +stop () +{ + [ -f /var/lock/subsys/$NAME ] || return 0 + echo -n "Killing $NAME: " + killproc $NAME + echo + rm -f /var/lock/subsys/$NAME +} + +restart () +{ + stop + start +} + +condrestart () +{ + [ -e /var/lock/subsys/$NAME ] && restart || return 0 +} + +status () +{ + cd $BUGZILLA && $BIN -p $PIDFILE -n $NAME check +} + +case "$1" in + start) start; RETVAL=$? ;; + stop) stop; RETVAL=$? ;; + status) status; RETVAL=$?;; + restart) restart; RETVAL=$? ;; + condrestart) condrestart; RETVAL=$? ;; + *) usage ; RETVAL=2 ;; +esac + +exit $RETVAL diff --git a/vagrant_support/checksetup.yml b/vagrant_support/checksetup.yml new file mode 100644 index 000000000..658863914 --- /dev/null +++ b/vagrant_support/checksetup.yml @@ -0,0 +1,32 @@ +--- +- name: bmo reconfiguration script + template: + src: bmo-reconfigure.j2 + dest: /usr/local/bin/bmo-reconfigure + mode: 0755 + +- name: bmo checksetup answers + template: + src: checksetup_answers.j2 + dest: /home/vagrant/checksetup_answers.txt + mode: 644 + +- name: copy bmo config checker script + copy: + src: bmo-configured + dest: /usr/local/bin/bmo-configured + mode: 0755 + +- name: 'check bmo config (failure is okay)' + shell: /usr/local/bin/bmo-configured + register: bmo_configured + ignore_errors: true + +- name: configure bmo + become: false + shell: sg apache -c '/usr/local/bin/bmo-reconfigure' + when: bmo_configured|failed + +- name: check bmo config + shell: /usr/local/bin/bmo-configured + when: bmo_configured|failed diff --git a/vagrant_support/checksetup_answers.j2 b/vagrant_support/checksetup_answers.j2 new file mode 100644 index 000000000..32d337cad --- /dev/null +++ b/vagrant_support/checksetup_answers.j2 @@ -0,0 +1,37 @@ +$answer{'ADMIN_EMAIL'} = 'vagrant@{{ WEB_HOSTNAME }}'; +$answer{'ADMIN_OK'} = 'Y'; +$answer{'ADMIN_PASSWORD'} = 'vagrant01!'; +$answer{'ADMIN_REALNAME'} = 'Vagrant User'; +$answer{'NO_PAUSE'} = 1; +$answer{'apache_size_limit'} = 700000; +$answer{'bugzilla_version'} = '1'; +$answer{'create_htaccess'} = ''; +$answer{'db_check'} = 1; +$answer{'db_driver'} = 'mysql'; +$answer{'db_host'} = '{{DB_IP}}'; +$answer{'db_name'} = 'bugs_bmo'; +$answer{'db_pass'} = 'bugs'; +$answer{'db_port'} = 0; +$answer{'db_sock'} = ''; +$answer{'db_user'} = 'bugs'; +$answer{'diffpath'} = '/usr/bin'; +$answer{'index_html'} = 0; +$answer{'interdiffbin'} = '/usr/bin/interdiff'; +$answer{'password_complexity'} = 'bmo'; +$answer{'user_info_class'} = 'GitHubAuth,CGI'; +$answer{'user_verify_class'} = 'GitHubAuth,DB'; +$answer{'urlbase'} = "http://{{WEB_HOSTNAME}}/"; +$answer{'memcached_namespace'} = 'bmo:'; +$answer{'memcached_servers'} = '127.0.0.1:11211'; +$answer{'use_mailer_queue'} = 1; +$answer{'useclassification'} = 1; +$answer{'usebugaliases'} = 1; +$answer{'upgrade_notification'} = 0; +$answer{'usestatuswhiteboard'} = 1; +$answer{'usetargetmilestone'} = 1; +$answer{'webdotbase'} = '/usr/bin/dot'; +$answer{'auth_delegation'} = 1; +$answer{'insidergroup'} = 'admin'; +$answer{'defaultpriority'} = '--'; +$answer{'defaultseverity'} = 'normal'; +$answer{'skin'} = 'Mozilla'; diff --git a/vagrant_support/cron.yml b/vagrant_support/cron.yml new file mode 100644 index 000000000..e41d7d6f9 --- /dev/null +++ b/vagrant_support/cron.yml @@ -0,0 +1,45 @@ +- name: set cron mailto + cron: + env: yes + name: MAILTO + value: vagrant@localhost + +- name: cron remove-idle-group-members + cron: + hour: 7 + minute: 0 + job: 'cd /vagrant; ./scripts/remove_idle_group_members.pl' + +- name: cron collectstats + cron: + hour: 7 + minute: 0 + job: 'cd /vagrant; ./collectstats.pl' + + +- name: cron whine + cron: + user: apache + minute: '*/15' + job: 'cd /vagrant; ./whine.pl' + +- name: cron clean-bug-user-last-visit + cron: + user: apache + hour: 7 + minute: 0 + job: 'cd /vagrant; ./clean-bug-user-last-visit.pl' + +- name: request nagger + cron: + user: apache + hour: 7 + minute: 30 + job: 'cd /vagrant; ./extensions/RequestNagger/bin/send-request-nags.pl' + +- name: userprofile + cron: + user: apache + hour: 7 + minute: 30 + job: 'cd /vagrant; ./extensions/UserProfile/bin/update.pl' diff --git a/vagrant_support/devtools.yml b/vagrant_support/devtools.yml new file mode 100644 index 000000000..bfc62cb2a --- /dev/null +++ b/vagrant_support/devtools.yml @@ -0,0 +1,4 @@ +--- +- name: copy bashrc + copy: src=bashrc dest=/home/vagrant/.bashrc mode=0644 + diff --git a/vagrant_support/dovecot.j2 b/vagrant_support/dovecot.j2 new file mode 100644 index 000000000..31a35201a --- /dev/null +++ b/vagrant_support/dovecot.j2 @@ -0,0 +1,15 @@ +protocols = pop3 imap +ssl = no +auth_mechanisms = plain login cram-md5 digest-md5 +disable_plaintext_auth = no +mail_location = mbox:~/mail:INBOX=/var/mail/%u +mail_access_groups=mail + +userdb { + driver = passwd +} + +passdb { + driver = static + args = nopassword=yes +} diff --git a/vagrant_support/email.yml b/vagrant_support/email.yml new file mode 100644 index 000000000..a988e240b --- /dev/null +++ b/vagrant_support/email.yml @@ -0,0 +1,32 @@ +--- + +- name: install mail packages + yum: name={{item}} state=present + with_items: ["mutt", "postfix", "dovecot"] + +- name: configure postfix + copy: + src: postfix/main.cf + dest: /etc/postfix/main.cf + +- name: redirect all email to vagrant user + copy: + src: postfix/virtual + dest: /etc/postfix/virtual + +- name: enable postfix + service: name=postfix enabled=yes + +- name: restart postfix + service: name=postfix state=restarted + +- name: configure dovecot + template: + src: dovecot.j2 + dest: /etc/dovecot/dovecot.conf + +- name: enable dovecot + service: name=dovecot enabled=yes + +- name: restart dovecot + service: name=dovecot state=restarted diff --git a/vagrant_support/jobqueue.yml b/vagrant_support/jobqueue.yml new file mode 100644 index 000000000..aeec65cbc --- /dev/null +++ b/vagrant_support/jobqueue.yml @@ -0,0 +1,21 @@ +- name: install job queue + command: /vagrant/jobqueue.pl install chdir=/vagrant creates=/etc/init.d/bugzilla-queue + +- name: configure jobqueue + copy: + dest: /etc/sysconfig/bugzilla-queue + mode: 0644 + content: | + BUGZILLA=/vagrant + USER=vagrant + +- name: fix jobqueue perms + file: + path: /vagrant/jobqueue.pl + mode: 0750 + +- name: enable jobqueue + service: name=bugzilla-queue enabled=yes + +- name: restart jobqueue + service: name=bugzilla-queue state=restarted diff --git a/vagrant_support/memcached.yml b/vagrant_support/memcached.yml new file mode 100644 index 000000000..2031c2e2a --- /dev/null +++ b/vagrant_support/memcached.yml @@ -0,0 +1,10 @@ +--- + +- name: install memcached + yum: name=memcached state=present + +- name: enable memcached + service: name=memcached enabled=yes + +- name: restart memcached + service: name=memcached state=restarted diff --git a/vagrant_support/my.cnf b/vagrant_support/my.cnf new file mode 100644 index 000000000..1daa4d745 --- /dev/null +++ b/vagrant_support/my.cnf @@ -0,0 +1,46 @@ +[mysqld] +datadir=/var/lib/mysql +socket=/var/lib/mysql/mysql.sock +user=mysql +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 + +default_storage_engine = InnoDB +key_buffer_size = 32M +myisam_recover = FORCE,BACKUP +max_allowed_packet = 1G +max_connect_errors = 1000000 +innodb = FORCE +datadir = /var/lib/mysql +character-set-server = utf8 +collation-server = utf8_general_ci + +tmp_table_size = 32M +max_heap_table_size = 32M +query_cache_type = 0 +query_cache_size = 0 +max_connections = 500 +thread_cache_size = 50 +#open_files_limit = 65535 +table_definition_cache = 1024 +table_open_cache = 2048 + +innodb_flush_method = O_DIRECT +innodb_log_files_in_group = 2 +innodb_log_file_size = 256M +innodb_flush_log_at_trx_commit = 2 +innodb_file_per_table = 1 +innodb_buffer_pool_size = 1G +innodb_flush_neighbors = 0 +innodb_flush_log_at_trx_commit = 2 + +log_error = /var/lib/mysql/mysql-error.log +log_queries_not_using_indexes = 0 +slow_query_log = 0 +slow_query_log_file = /var/lib/mysql/mysql-slow.log +general_log = 0 +general_log_file = /var/lib/mysql/bmo_query.log + +[mysqld_safe] +log-error=/var/log/mysqld.log +pid-file=/var/run/mysqld/mysqld.pid diff --git a/vagrant_support/playbook.yml b/vagrant_support/playbook.yml new file mode 100644 index 000000000..c8ebff01f --- /dev/null +++ b/vagrant_support/playbook.yml @@ -0,0 +1,176 @@ +--- +- hosts: all + become: true + tasks: + - include: timezone.yml + - name: install epel-release + yum: name=epel-release state=present + + - name: install common packages + yum: name={{item}} state=present + with_items: + - libselinux-python + - policycoreutils-python + - python-urllib3 + - python-pyasn1 + - python2-ndg_httpsclient + - pyOpenSSL + - htop + + - name: permissive selinux + selinux: state=permissive policy=targeted + + - name: disable selinux on reboot + selinux: state=disabled + + - name: 'add {{WEB_HOSTNAME}} to /etc/hosts' + lineinfile: + dest: /etc/hosts + regexp: '{{WEB_HOSTNAME}}' + line: '{{WEB_IP}} {{WEB_HOSTNAME}}' + owner: root + group: root + mode: 0644 + + - name: 'add {{DB_HOSTNAME}} to /etc/hosts' + lineinfile: + dest: /etc/hosts + regexp: '{{DB_HOSTNAME}}' + line: '{{DB_IP}} {{DB_HOSTNAME}}' + owner: root + group: root + mode: 0644 + +- hosts: db + become: true + tasks: + - name: fetch ius-release.rpm + get_url: + url: https://moz-devservices-bmocartons.s3.amazonaws.com/third-party/ius-release.rpm + dest: /tmp/ius-release.rpm + mode: 0600 + + - name: fetch mysql rpm + get_url: + url: https://moz-devservices-bmocartons.s3.amazonaws.com/third-party/mysql-community-release-el6-5.noarch.rpm + dest: /tmp/mysql-community-release-el6-5.noarch.rpm + mode: 0600 + + - name: add some extra repos + yum: name={{item}} state=present + with_items: + - /tmp/ius-release.rpm + - /tmp/mysql-community-release-el6-5.noarch.rpm + + - name: install mysql-server + yum: name=mysql-community-server state=present + + - name: copy my.cnf + copy: + src: my.cnf + dest: /etc/my.cnf + + - name: enable mysqld + service: name=mysqld enabled=yes + + - name: restart mysqld + service: name=mysqld state=restarted + + - name: 'check for bugs_bmo (failure is ok)' + shell: mysql -u root -e 'show databases' | grep bugs_bmo + register: bugs_bmo + ignore_errors: true + + - name: create bugs_bmo + shell: |- + mysqladmin -u root create bugs_bmo + mysql -u root -e 'GRANT ALL ON bugs_bmo.* TO bugs@"{{WEB_IP}}" IDENTIFIED BY "bugs"' + when: bugs_bmo|failed + +- hosts: web + become: true + tasks: + - name: install web-specific packages + yum: name={{item}} state=present + with_items: + - autoconf + - automake + - binutils + - bison + - byacc + - elfutils + - flex + - gcc + - gcc-c++ + - gd + - gd-devel + - gettext + - git + - libtool + - make + - mod_perl + - mod_perl-devel + - openssl + - openssl-devel + - patch + - patchutils + - perl + - perl-core + - pkgconfig + - rpm-build + - graphviz + + - name: fetch cpanm + get_url: + url: http://cpanmin.us + dest: /usr/local/bin/cpanm + mode: '0755' + - name: install more recent Apache2::SizeLimit + cpanm: name=Apache2::SizeLimit executable=/usr/local/bin/cpanm + + - name: 'check /opt/bmo (failure is ok)' + shell: test -d /opt/bmo && test -f /opt/bmo/local/lib/perl5/Plack.pm + register: opt_bmo + ignore_errors: true + + - name: install vendor tarball + unarchive: + src: '{{VENDOR_BUNDLE_URL}}' + dest: /opt + remote_src: true + when: opt_bmo|failed + + - name: check /opt/bmo + shell: test -d /opt/bmo && test -f /opt/bmo/local/lib/perl5/Plack.pm + when: opt_bmo|failed + + - name: add local symlink + file: path=/vagrant/local src=/opt/bmo/local state=link force=true + + - name: make bmo data dir + file: path=/data state=directory owner=vagrant group=apache mode=0775 + + - name: fix perms + file: path=/vagrant state=directory owner=vagrant group=apache recurse=yes + + - name: add data symlink + file: path=/vagrant/data src=/data state=link force=true + + - include: memcached.yml + + - name: add vagrant to apache group + user: name=vagrant groups=apache append=yes + + - name: bmo bundle refresher script + template: + src: bmo-refresh-bundle.j2 + dest: /usr/local/bin/bmo-refresh-bundle + mode: 0755 + + - include: checksetup.yml + - include: cron.yml + - include: jobqueue.yml + - include: push.yml + - include: email.yml + - include: apache.yml + - include: devtools.yml diff --git a/vagrant_support/postfix/main.cf b/vagrant_support/postfix/main.cf new file mode 100644 index 000000000..025a1d502 --- /dev/null +++ b/vagrant_support/postfix/main.cf @@ -0,0 +1,678 @@ +# Global Postfix configuration file. This file lists only a subset +# of all parameters. For the syntax, and for a complete parameter +# list, see the postconf(5) manual page (command: "man 5 postconf"). +# +# For common configuration examples, see BASIC_CONFIGURATION_README +# and STANDARD_CONFIGURATION_README. To find these documents, use +# the command "postconf html_directory readme_directory", or go to +# http://www.postfix.org/. +# +# For best results, change no more than 2-3 parameters at a time, +# and test if Postfix still works after every change. + +# SOFT BOUNCE +# +# The soft_bounce parameter provides a limited safety net for +# testing. When soft_bounce is enabled, mail will remain queued that +# would otherwise bounce. This parameter disables locally-generated +# bounces, and prevents the SMTP server from rejecting mail permanently +# (by changing 5xx replies into 4xx replies). However, soft_bounce +# is no cure for address rewriting mistakes or mail routing mistakes. +# +#soft_bounce = no + +# LOCAL PATHNAME INFORMATION +# +# The queue_directory specifies the location of the Postfix queue. +# This is also the root directory of Postfix daemons that run chrooted. +# See the files in examples/chroot-setup for setting up Postfix chroot +# environments on different UNIX systems. +# +queue_directory = /var/spool/postfix + +# The command_directory parameter specifies the location of all +# postXXX commands. +# +command_directory = /usr/sbin + +# The daemon_directory parameter specifies the location of all Postfix +# daemon programs (i.e. programs listed in the master.cf file). This +# directory must be owned by root. +# +daemon_directory = /usr/libexec/postfix + +# The data_directory parameter specifies the location of Postfix-writable +# data files (caches, random numbers). This directory must be owned +# by the mail_owner account (see below). +# +data_directory = /var/lib/postfix + +# QUEUE AND PROCESS OWNERSHIP +# +# The mail_owner parameter specifies the owner of the Postfix queue +# and of most Postfix daemon processes. Specify the name of a user +# account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS +# AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In +# particular, don't specify nobody or daemon. PLEASE USE A DEDICATED +# USER. +# +mail_owner = postfix + +# The default_privs parameter specifies the default rights used by +# the local delivery agent for delivery to external file or command. +# These rights are used in the absence of a recipient user context. +# DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER. +# +#default_privs = nobody + +# INTERNET HOST AND DOMAIN NAMES +# +# The myhostname parameter specifies the internet hostname of this +# mail system. The default is to use the fully-qualified domain name +# from gethostname(). $myhostname is used as a default value for many +# other configuration parameters. +# +#myhostname = host.domain.tld +#myhostname = virtual.domain.tld + +# The mydomain parameter specifies the local internet domain name. +# The default is to use $myhostname minus the first component. +# $mydomain is used as a default value for many other configuration +# parameters. +# +#mydomain = domain.tld + +# SENDING MAIL +# +# The myorigin parameter specifies the domain that locally-posted +# mail appears to come from. The default is to append $myhostname, +# which is fine for small sites. If you run a domain with multiple +# machines, you should (1) change this to $mydomain and (2) set up +# a domain-wide alias database that aliases each user to +# user@that.users.mailhost. +# +# For the sake of consistency between sender and recipient addresses, +# myorigin also specifies the default domain name that is appended +# to recipient addresses that have no @domain part. +# +#myorigin = $myhostname +#myorigin = $mydomain + +# RECEIVING MAIL + +# The inet_interfaces parameter specifies the network interface +# addresses that this mail system receives mail on. By default, +# the software claims all active interfaces on the machine. The +# parameter also controls delivery of mail to user@[ip.address]. +# +# See also the proxy_interfaces parameter, for network addresses that +# are forwarded to us via a proxy or network address translator. +# +# Note: you need to stop/start Postfix when this parameter changes. +# +#inet_interfaces = all +#inet_interfaces = $myhostname +#inet_interfaces = $myhostname, localhost +inet_interfaces = localhost + +# Enable IPv4, and IPv6 if supported +inet_protocols = all + +# The proxy_interfaces parameter specifies the network interface +# addresses that this mail system receives mail on by way of a +# proxy or network address translation unit. This setting extends +# the address list specified with the inet_interfaces parameter. +# +# You must specify your proxy/NAT addresses when your system is a +# backup MX host for other domains, otherwise mail delivery loops +# will happen when the primary MX host is down. +# +#proxy_interfaces = +#proxy_interfaces = 1.2.3.4 + +# The mydestination parameter specifies the list of domains that this +# machine considers itself the final destination for. +# +# These domains are routed to the delivery agent specified with the +# local_transport parameter setting. By default, that is the UNIX +# compatible delivery agent that lookups all recipients in /etc/passwd +# and /etc/aliases or their equivalent. +# +# The default is $myhostname + localhost.$mydomain. On a mail domain +# gateway, you should also include $mydomain. +# +# Do not specify the names of virtual domains - those domains are +# specified elsewhere (see VIRTUAL_README). +# +# Do not specify the names of domains that this machine is backup MX +# host for. Specify those names via the relay_domains settings for +# the SMTP server, or use permit_mx_backup if you are lazy (see +# STANDARD_CONFIGURATION_README). +# +# The local machine is always the final destination for mail addressed +# to user@[the.net.work.address] of an interface that the mail system +# receives mail on (see the inet_interfaces parameter). +# +# Specify a list of host or domain names, /file/name or type:table +# patterns, separated by commas and/or whitespace. A /file/name +# pattern is replaced by its contents; a type:table is matched when +# a name matches a lookup key (the right-hand side is ignored). +# Continue long lines by starting the next line with whitespace. +# +# See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS". +# +mydestination = $myhostname, localhost.$mydomain, localhost +#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain +#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, +# mail.$mydomain, www.$mydomain, ftp.$mydomain + +# REJECTING MAIL FOR UNKNOWN LOCAL USERS +# +# The local_recipient_maps parameter specifies optional lookup tables +# with all names or addresses of users that are local with respect +# to $mydestination, $inet_interfaces or $proxy_interfaces. +# +# If this parameter is defined, then the SMTP server will reject +# mail for unknown local users. This parameter is defined by default. +# +# To turn off local recipient checking in the SMTP server, specify +# local_recipient_maps = (i.e. empty). +# +# The default setting assumes that you use the default Postfix local +# delivery agent for local delivery. You need to update the +# local_recipient_maps setting if: +# +# - You define $mydestination domain recipients in files other than +# /etc/passwd, /etc/aliases, or the $virtual_alias_maps files. +# For example, you define $mydestination domain recipients in +# the $virtual_mailbox_maps files. +# +# - You redefine the local delivery agent in master.cf. +# +# - You redefine the "local_transport" setting in main.cf. +# +# - You use the "luser_relay", "mailbox_transport", or "fallback_transport" +# feature of the Postfix local delivery agent (see local(8)). +# +# Details are described in the LOCAL_RECIPIENT_README file. +# +# Beware: if the Postfix SMTP server runs chrooted, you probably have +# to access the passwd file via the proxymap service, in order to +# overcome chroot restrictions. The alternative, having a copy of +# the system passwd file in the chroot jail is just not practical. +# +# The right-hand side of the lookup tables is conveniently ignored. +# In the left-hand side, specify a bare username, an @domain.tld +# wild-card, or specify a user@domain.tld address. +# +#local_recipient_maps = unix:passwd.byname $alias_maps +#local_recipient_maps = proxy:unix:passwd.byname $alias_maps +#local_recipient_maps = + +# The unknown_local_recipient_reject_code specifies the SMTP server +# response code when a recipient domain matches $mydestination or +# ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty +# and the recipient address or address local-part is not found. +# +# The default setting is 550 (reject mail) but it is safer to start +# with 450 (try again later) until you are certain that your +# local_recipient_maps settings are OK. +# +unknown_local_recipient_reject_code = 550 + +# TRUST AND RELAY CONTROL + +# The mynetworks parameter specifies the list of "trusted" SMTP +# clients that have more privileges than "strangers". +# +# In particular, "trusted" SMTP clients are allowed to relay mail +# through Postfix. See the smtpd_recipient_restrictions parameter +# in postconf(5). +# +# You can specify the list of "trusted" network addresses by hand +# or you can let Postfix do it for you (which is the default). +# +# By default (mynetworks_style = subnet), Postfix "trusts" SMTP +# clients in the same IP subnetworks as the local machine. +# On Linux, this does works correctly only with interfaces specified +# with the "ifconfig" command. +# +# Specify "mynetworks_style = class" when Postfix should "trust" SMTP +# clients in the same IP class A/B/C networks as the local machine. +# Don't do this with a dialup site - it would cause Postfix to "trust" +# your entire provider's network. Instead, specify an explicit +# mynetworks list by hand, as described below. +# +# Specify "mynetworks_style = host" when Postfix should "trust" +# only the local machine. +# +#mynetworks_style = class +#mynetworks_style = subnet +#mynetworks_style = host + +# Alternatively, you can specify the mynetworks list by hand, in +# which case Postfix ignores the mynetworks_style setting. +# +# Specify an explicit list of network/netmask patterns, where the +# mask specifies the number of bits in the network part of a host +# address. +# +# You can also specify the absolute pathname of a pattern file instead +# of listing the patterns here. Specify type:table for table-based lookups +# (the value on the table right-hand side is not used). +# +#mynetworks = 168.100.189.0/28, 127.0.0.0/8 +#mynetworks = $config_directory/mynetworks +#mynetworks = hash:/etc/postfix/network_table + +# The relay_domains parameter restricts what destinations this system will +# relay mail to. See the smtpd_recipient_restrictions description in +# postconf(5) for detailed information. +# +# By default, Postfix relays mail +# - from "trusted" clients (IP address matches $mynetworks) to any destination, +# - from "untrusted" clients to destinations that match $relay_domains or +# subdomains thereof, except addresses with sender-specified routing. +# The default relay_domains value is $mydestination. +# +# In addition to the above, the Postfix SMTP server by default accepts mail +# that Postfix is final destination for: +# - destinations that match $inet_interfaces or $proxy_interfaces, +# - destinations that match $mydestination +# - destinations that match $virtual_alias_domains, +# - destinations that match $virtual_mailbox_domains. +# These destinations do not need to be listed in $relay_domains. +# +# Specify a list of hosts or domains, /file/name patterns or type:name +# lookup tables, separated by commas and/or whitespace. Continue +# long lines by starting the next line with whitespace. A file name +# is replaced by its contents; a type:name table is matched when a +# (parent) domain appears as lookup key. +# +# NOTE: Postfix will not automatically forward mail for domains that +# list this system as their primary or backup MX host. See the +# permit_mx_backup restriction description in postconf(5). +# +#relay_domains = $mydestination + +# INTERNET OR INTRANET + +# The relayhost parameter specifies the default host to send mail to +# when no entry is matched in the optional transport(5) table. When +# no relayhost is given, mail is routed directly to the destination. +# +# On an intranet, specify the organizational domain name. If your +# internal DNS uses no MX records, specify the name of the intranet +# gateway host instead. +# +# In the case of SMTP, specify a domain, host, host:port, [host]:port, +# [address] or [address]:port; the form [host] turns off MX lookups. +# +# If you're connected via UUCP, see also the default_transport parameter. +# +#relayhost = $mydomain +#relayhost = [gateway.my.domain] +#relayhost = [mailserver.isp.tld] +#relayhost = uucphost +#relayhost = [an.ip.add.ress] + +# REJECTING UNKNOWN RELAY USERS +# +# The relay_recipient_maps parameter specifies optional lookup tables +# with all addresses in the domains that match $relay_domains. +# +# If this parameter is defined, then the SMTP server will reject +# mail for unknown relay users. This feature is off by default. +# +# The right-hand side of the lookup tables is conveniently ignored. +# In the left-hand side, specify an @domain.tld wild-card, or specify +# a user@domain.tld address. +# +#relay_recipient_maps = hash:/etc/postfix/relay_recipients + +# INPUT RATE CONTROL +# +# The in_flow_delay configuration parameter implements mail input +# flow control. This feature is turned on by default, although it +# still needs further development (it's disabled on SCO UNIX due +# to an SCO bug). +# +# A Postfix process will pause for $in_flow_delay seconds before +# accepting a new message, when the message arrival rate exceeds the +# message delivery rate. With the default 100 SMTP server process +# limit, this limits the mail inflow to 100 messages a second more +# than the number of messages delivered per second. +# +# Specify 0 to disable the feature. Valid delays are 0..10. +# +#in_flow_delay = 1s + +# ADDRESS REWRITING +# +# The ADDRESS_REWRITING_README document gives information about +# address masquerading or other forms of address rewriting including +# username->Firstname.Lastname mapping. + +# ADDRESS REDIRECTION (VIRTUAL DOMAIN) +# +# The VIRTUAL_README document gives information about the many forms +# of domain hosting that Postfix supports. + +# "USER HAS MOVED" BOUNCE MESSAGES +# +# See the discussion in the ADDRESS_REWRITING_README document. + +# TRANSPORT MAP +# +# See the discussion in the ADDRESS_REWRITING_README document. + +# ALIAS DATABASE +# +# The alias_maps parameter specifies the list of alias databases used +# by the local delivery agent. The default list is system dependent. +# +# On systems with NIS, the default is to search the local alias +# database, then the NIS alias database. See aliases(5) for syntax +# details. +# +# If you change the alias database, run "postalias /etc/aliases" (or +# wherever your system stores the mail alias file), or simply run +# "newaliases" to build the necessary DBM or DB file. +# +# It will take a minute or so before changes become visible. Use +# "postfix reload" to eliminate the delay. +# +#alias_maps = dbm:/etc/aliases +alias_maps = hash:/etc/aliases +#alias_maps = hash:/etc/aliases, nis:mail.aliases +#alias_maps = netinfo:/aliases + +# The alias_database parameter specifies the alias database(s) that +# are built with "newaliases" or "sendmail -bi". This is a separate +# configuration parameter, because alias_maps (see above) may specify +# tables that are not necessarily all under control by Postfix. +# +#alias_database = dbm:/etc/aliases +#alias_database = dbm:/etc/mail/aliases +alias_database = hash:/etc/aliases +#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases + +# ADDRESS EXTENSIONS (e.g., user+foo) +# +# The recipient_delimiter parameter specifies the separator between +# user names and address extensions (user+foo). See canonical(5), +# local(8), relocated(5) and virtual(5) for the effects this has on +# aliases, canonical, virtual, relocated and .forward file lookups. +# Basically, the software tries user+foo and .forward+foo before +# trying user and .forward. +# +#recipient_delimiter = + + +# DELIVERY TO MAILBOX +# +# The home_mailbox parameter specifies the optional pathname of a +# mailbox file relative to a user's home directory. The default +# mailbox file is /var/spool/mail/user or /var/mail/user. Specify +# "Maildir/" for qmail-style delivery (the / is required). +# +#home_mailbox = Mailbox +#home_mailbox = Maildir/ + +# The mail_spool_directory parameter specifies the directory where +# UNIX-style mailboxes are kept. The default setting depends on the +# system type. +# +#mail_spool_directory = /var/mail +#mail_spool_directory = /var/spool/mail + +# The mailbox_command parameter specifies the optional external +# command to use instead of mailbox delivery. The command is run as +# the recipient with proper HOME, SHELL and LOGNAME environment settings. +# Exception: delivery for root is done as $default_user. +# +# Other environment variables of interest: USER (recipient username), +# EXTENSION (address extension), DOMAIN (domain part of address), +# and LOCAL (the address localpart). +# +# Unlike other Postfix configuration parameters, the mailbox_command +# parameter is not subjected to $parameter substitutions. This is to +# make it easier to specify shell syntax (see example below). +# +# Avoid shell meta characters because they will force Postfix to run +# an expensive shell process. Procmail alone is expensive enough. +# +# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN +# ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER. +# +#mailbox_command = /some/where/procmail +#mailbox_command = /some/where/procmail -a "$EXTENSION" + +# The mailbox_transport specifies the optional transport in master.cf +# to use after processing aliases and .forward files. This parameter +# has precedence over the mailbox_command, fallback_transport and +# luser_relay parameters. +# +# Specify a string of the form transport:nexthop, where transport is +# the name of a mail delivery transport defined in master.cf. The +# :nexthop part is optional. For more details see the sample transport +# configuration file. +# +# NOTE: if you use this feature for accounts not in the UNIX password +# file, then you must update the "local_recipient_maps" setting in +# the main.cf file, otherwise the SMTP server will reject mail for +# non-UNIX accounts with "User unknown in local recipient table". +# +#mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp + +# If using the cyrus-imapd IMAP server deliver local mail to the IMAP +# server using LMTP (Local Mail Transport Protocol), this is prefered +# over the older cyrus deliver program by setting the +# mailbox_transport as below: +# +# mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp +# +# The efficiency of LMTP delivery for cyrus-imapd can be enhanced via +# these settings. +# +# local_destination_recipient_limit = 300 +# local_destination_concurrency_limit = 5 +# +# Of course you should adjust these settings as appropriate for the +# capacity of the hardware you are using. The recipient limit setting +# can be used to take advantage of the single instance message store +# capability of Cyrus. The concurrency limit can be used to control +# how many simultaneous LMTP sessions will be permitted to the Cyrus +# message store. +# +# To use the old cyrus deliver program you have to set: +#mailbox_transport = cyrus + +# The fallback_transport specifies the optional transport in master.cf +# to use for recipients that are not found in the UNIX passwd database. +# This parameter has precedence over the luser_relay parameter. +# +# Specify a string of the form transport:nexthop, where transport is +# the name of a mail delivery transport defined in master.cf. The +# :nexthop part is optional. For more details see the sample transport +# configuration file. +# +# NOTE: if you use this feature for accounts not in the UNIX password +# file, then you must update the "local_recipient_maps" setting in +# the main.cf file, otherwise the SMTP server will reject mail for +# non-UNIX accounts with "User unknown in local recipient table". +# +#fallback_transport = lmtp:unix:/var/lib/imap/socket/lmtp +#fallback_transport = + +# The luser_relay parameter specifies an optional destination address +# for unknown recipients. By default, mail for unknown@$mydestination, +# unknown@[$inet_interfaces] or unknown@[$proxy_interfaces] is returned +# as undeliverable. +# +# The following expansions are done on luser_relay: $user (recipient +# username), $shell (recipient shell), $home (recipient home directory), +# $recipient (full recipient address), $extension (recipient address +# extension), $domain (recipient domain), $local (entire recipient +# localpart), $recipient_delimiter. Specify ${name?value} or +# ${name:value} to expand value only when $name does (does not) exist. +# +# luser_relay works only for the default Postfix local delivery agent. +# +# NOTE: if you use this feature for accounts not in the UNIX password +# file, then you must specify "local_recipient_maps =" (i.e. empty) in +# the main.cf file, otherwise the SMTP server will reject mail for +# non-UNIX accounts with "User unknown in local recipient table". +# +#luser_relay = $user@other.host +#luser_relay = $local@other.host +#luser_relay = admin+$local + +# JUNK MAIL CONTROLS +# +# The controls listed here are only a very small subset. The file +# SMTPD_ACCESS_README provides an overview. + +# The header_checks parameter specifies an optional table with patterns +# that each logical message header is matched against, including +# headers that span multiple physical lines. +# +# By default, these patterns also apply to MIME headers and to the +# headers of attached messages. With older Postfix versions, MIME and +# attached message headers were treated as body text. +# +# For details, see "man header_checks". +# +#header_checks = regexp:/etc/postfix/header_checks + +# FAST ETRN SERVICE +# +# Postfix maintains per-destination logfiles with information about +# deferred mail, so that mail can be flushed quickly with the SMTP +# "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld". +# See the ETRN_README document for a detailed description. +# +# The fast_flush_domains parameter controls what destinations are +# eligible for this service. By default, they are all domains that +# this server is willing to relay mail to. +# +#fast_flush_domains = $relay_domains + +# SHOW SOFTWARE VERSION OR NOT +# +# The smtpd_banner parameter specifies the text that follows the 220 +# code in the SMTP server's greeting banner. Some people like to see +# the mail version advertised. By default, Postfix shows no version. +# +# You MUST specify $myhostname at the start of the text. That is an +# RFC requirement. Postfix itself does not care. +# +#smtpd_banner = $myhostname ESMTP $mail_name +#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) + +# PARALLEL DELIVERY TO THE SAME DESTINATION +# +# How many parallel deliveries to the same user or domain? With local +# delivery, it does not make sense to do massively parallel delivery +# to the same user, because mailbox updates must happen sequentially, +# and expensive pipelines in .forward files can cause disasters when +# too many are run at the same time. With SMTP deliveries, 10 +# simultaneous connections to the same domain could be sufficient to +# raise eyebrows. +# +# Each message delivery transport has its XXX_destination_concurrency_limit +# parameter. The default is $default_destination_concurrency_limit for +# most delivery transports. For the local delivery agent the default is 2. + +#local_destination_concurrency_limit = 2 +#default_destination_concurrency_limit = 20 + +# DEBUGGING CONTROL +# +# The debug_peer_level parameter specifies the increment in verbose +# logging level when an SMTP client or server host name or address +# matches a pattern in the debug_peer_list parameter. +# +debug_peer_level = 2 + +# The debug_peer_list parameter specifies an optional list of domain +# or network patterns, /file/name patterns or type:name tables. When +# an SMTP client or server host name or address matches a pattern, +# increase the verbose logging level by the amount specified in the +# debug_peer_level parameter. +# +#debug_peer_list = 127.0.0.1 +#debug_peer_list = some.domain + +# The debugger_command specifies the external command that is executed +# when a Postfix daemon program is run with the -D option. +# +# Use "command .. & sleep 5" so that the debugger can attach before +# the process marches on. If you use an X-based debugger, be sure to +# set up your XAUTHORITY environment variable before starting Postfix. +# +debugger_command = + PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin + ddd $daemon_directory/$process_name $process_id & sleep 5 + +# If you can't use X, use this to capture the call stack when a +# daemon crashes. The result is in a file in the configuration +# directory, and is named after the process name and the process ID. +# +# debugger_command = +# PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont; +# echo where) | gdb $daemon_directory/$process_name $process_id 2>&1 +# >$config_directory/$process_name.$process_id.log & sleep 5 +# +# Another possibility is to run gdb under a detached screen session. +# To attach to the screen sesssion, su root and run "screen -r +# " where uniquely matches one of the detached +# sessions (from "screen -list"). +# +# debugger_command = +# PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; screen +# -dmS $process_name gdb $daemon_directory/$process_name +# $process_id & sleep 1 + +# INSTALL-TIME CONFIGURATION INFORMATION +# +# The following parameters are used when installing a new Postfix version. +# +# sendmail_path: The full pathname of the Postfix sendmail command. +# This is the Sendmail-compatible mail posting interface. +# +sendmail_path = /usr/sbin/sendmail.postfix + +# newaliases_path: The full pathname of the Postfix newaliases command. +# This is the Sendmail-compatible command to build alias databases. +# +newaliases_path = /usr/bin/newaliases.postfix + +# mailq_path: The full pathname of the Postfix mailq command. This +# is the Sendmail-compatible mail queue listing command. +# +mailq_path = /usr/bin/mailq.postfix + +# setgid_group: The group for mail submission and queue management +# commands. This must be a group name with a numerical group ID that +# is not shared with other accounts, not even with the Postfix account. +# +setgid_group = postdrop + +# html_directory: The location of the Postfix HTML documentation. +# +html_directory = no + +# manpage_directory: The location of the Postfix on-line manual pages. +# +manpage_directory = /usr/share/man + +# sample_directory: The location of the Postfix sample configuration files. +# This parameter is obsolete as of Postfix 2.1. +# +sample_directory = /usr/share/doc/postfix-2.6.6/samples + +# readme_directory: The location of the Postfix README files. +# +readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES + +virtual_alias_maps = pcre:/etc/postfix/virtual diff --git a/vagrant_support/postfix/virtual b/vagrant_support/postfix/virtual new file mode 100644 index 000000000..12e906541 --- /dev/null +++ b/vagrant_support/postfix/virtual @@ -0,0 +1 @@ +/.*/ vagrant diff --git a/vagrant_support/push.yml b/vagrant_support/push.yml new file mode 100644 index 000000000..179f1d2a6 --- /dev/null +++ b/vagrant_support/push.yml @@ -0,0 +1,15 @@ +- name: push daemon sysconfig + copy: + dest: /etc/sysconfig/bugzilla-push + mode: 0644 + content: | + BUGZILLA=/vagrant + USER=vagrant + +- name: push daemon init file + template: + dest: /etc/init.d/bugzilla-push + src: bugzilla-push + owner: root + group: root + mode: 0755 diff --git a/vagrant_support/timezone.yml b/vagrant_support/timezone.yml new file mode 100644 index 000000000..f0e1b5f26 --- /dev/null +++ b/vagrant_support/timezone.yml @@ -0,0 +1,18 @@ +--- + +- name: check for non-link localtime + stat: path=/etc/localtime + register: localtime + +- name: remove localtime + file: + path: /etc/localtime + state: absent + when: localtime.stat.islnk is defined and localtime.stat.islnk == False + +- name: set timezone to same as production + file: + path: /etc/localtime + src: /usr/share/zoneinfo/America/Los_Angeles + force: true + state: link -- cgit v1.2.3-24-g4f1b