Simplest Enterprise Continuous Integration Solutions

Saturday, April 7, 2012

Puppet Deployment: Puppet Enterprise

Puppet Enterprise installation - puppet-enterprise-2.5.0-el-5-x86_64

# Java 1.6

[root@linux64-puppet-server ~]# /tmp/jdk-6u23-linux-x64.bin
[root@linux64-puppet-server ~]# echo “export PATH=/opt/jdk1.6.0_23/bin:$PATH” >> ~/.bashrc
[root@linux64-puppet-server ~]# source ~/.bashrc
[root@linux64-puppet-server ~]# which java
/opt/jdk1.6.0_23/bin/java
java -version
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

# MySQL 5.1

[root@linux64-puppet-server ~]# rpm -Uvh /tmp/MySQL-shared-compat-5.5.25-1.rhel5.x86_64.rpm
[root@linux64-puppet-server ~]# rpm -Uvh /tmp/MySQL-client-community-5.5.25-1.rhel5.x86_64.rpm
[root@linux64-puppet-server ~]# rpm -Uvh /tmp/MySQL-server-community-5.5.25-1.rhel5.x86_64.rpm
[root@linux64-puppet-server ~]# /usr/bin/mysqladmin -u root password '********'

# Puppet Enterprise Master

[root@linux64-puppet-server ~]# cd /opt
[root@linux64-puppet-server opt]# tar zxvf /tmp/puppet-enterprise-2.5.0-el-5-x86_64.tar.gz

# make sure puppet prerequisites get installed

[root@linux64-puppet-server ~]# rpm –Uvh /opt/puppet-enterprise-2.5.0-el-5-x86_64/packages/el-5-x86_64/pe-virtual-java-1.0-1.pe.el5.noarch.rpm
[root@linux64-puppet-server ~]# cd puppet-enterprise-2.5.0-el-5-x86_64
[root@linux64-puppet-server puppet-enterprise-2.5.0-el-5-x86_64
]#
./puppet-enterprise-installer
=================================================================================================================================================

Puppet Enterprise v2.5.0 installer

Puppet Enterprise documentation can be found at http://links.puppetlabs.com/puppet_enterprise_2.5_documentation

-------------------------------------------------------------------------------------------------------------------------------------------------

STEP 1: SELECT AND CONFIGURE ROLES

   This installer will offer to install the puppet master, console, cloud provisioner, and puppet agent roles.

-> puppet master

   The puppet master serves configurations to a group of puppet agent nodes. This role also provides MCollective's message queue and client
   interface. It should be installed on a robust, dedicated server.

?? Install puppet master? [y/N] y

-> cloud provisioner

   The cloud provisioner can create and bootstrap new machine instances and add them to your Puppet infrastructure. It should be installed on
   a trusted node where site administrators have shell access.

?? Install the cloud provisioner? [y/N]

-> console

   The console is a web interface for viewing reports, classifying nodes, directly managing resources, controlling Puppet runs, and invoking
   MCollective agents. It should usually be installed on the puppet master server, but can also installed separately.

?? Install the console? [Y/n]

-> puppet agent

   The puppet agent role is automatically installed with the console, puppet master, and cloud provisioner roles.

?? The puppet master's certificate will contain a unique name ("certname"); this should be the main DNS name at which it can be reliably
   reached. Puppet master's certname? [Default: linux64-puppet-server] linux64-puppet-server.domain.com
?? The puppet master's certificate can contain DNS aliases; agent nodes will only trust the master if they reach it at its certname or one of
   these official aliases. Puppet master's DNS aliases (comma-separated list)? [Default:
   linux64-puppet-server,linux64-puppet-server.domain.com,puppet,puppet.domain.com]
?? Admin email address (will be used as account name) for accessing the console interface? pptadmin@domain.com
?? Password for user pptadmin@domain.com (minimum 8 characters)?
Confirm Password:
?? The console requires a MySQL database server. Install a new database server from your operating system's repository? [Y/n] n

   The console requires a MySQL database and a user account able to edit it.
?? Is your existing MySQL server running on a remote host? [y/N]
?? The console requires a database user with all privileges on both the console and inventory service databases as well as an auth user with
   its own database. Create the users and databases automatically? [Y/n]
?? To set up the console users and databases, the root MySQL password is required. What password does the 'root' user have on the database
   server?
Confirm Password:

   The console requires an SMTP server to email account information to users.
?? What is the name of your SMTP server? smtp.domain.com
?? Console database name? [Default: console]
?? Console database user? [Default: console]
?? Database user password (minimum 4 characters)?
Confirm Password:
?? What is the name of the authentication database? [Default: console_auth]
?? What is the name of the user authentication database user? [Default: console_auth]
?? What is the password for console_auth (the user authentication database user)?
Confirm Password:

-> Convenience Links

   The selected Puppet software will be installed into "/opt/puppet", which may not be included in your default shell PATH. For ease of use,
   this installer can create symbolic links to these executables in "/usr/local/bin".

?? Create symbolic links to Puppet executables in "/usr/local/bin"? [Y/n]

-------------------------------------------------------------------------------------------------------------------------------------------------

STEP 2: CONFIRM PLAN

You have selected to install the following components (and their dependencies)
* Puppet Master
* Console
* Puppet Agent

?? Perform installation? [Y/n]
## Saved answers to file: ./answers.lastrun.linux64-puppet-server

=================================================================================================================================================
## Saved answers to file: /etc/puppetlabs/installer/answers.install
Warning: overwriting /etc/puppetlabs/facter/facts.d/puppet_enterprise_installer.txt
Creating Backup: /etc/puppetlabs/facter/facts.d/puppet_enterprise_installer.txt.bak

-------------------------------------------------------------------------------------------------------------------------------------------------

STEP 3: INSTALL PACKAGES

## Installing packages from files...
Preparing...                ########################################### [100%]
   1:pe-ruby-libs           ########################################### [  3%]
   2:pe-ruby                ########################################### [  5%]
   3:pe-httpd               ########################################### [  8%]
   4:pe-ruby-mysql          ########################################### [ 10%]
   5:pe-facter              ########################################### [ 13%]
   6:pe-ruby-irb            ########################################### [ 15%]
   7:pe-ruby-rdoc           ########################################### [ 18%]
   8:pe-rubygems            ########################################### [ 20%]
   9:pe-rubygem-stomp       ########################################### [ 23%]
  10:pe-rubygem-rake        ########################################### [ 25%]
  11:pe-mcollective-common  ########################################### [ 28%]
  12:pe-rubygem-rack        ########################################### [ 30%]
  13:pe-httpd-passenger     ########################################### [ 33%]
  14:pe-rubygem-activesuppor########################################### [ 35%]
  15:pe-rubygem-activerecord########################################### [ 38%]
  16:pe-ruby-shadow         ########################################### [ 40%]
  17:pe-puppet              ########################################### [ 43%]
  18:pe-rubygem-hiera       ########################################### [ 45%]
  19:pe-augeas-libs         ########################################### [ 48%]
  20:pe-augeas              ########################################### [ 50%]
  21:pe-rubygem-hiera-puppet########################################### [ 52%]
  22:pe-puppet-server       ########################################### [ 55%]
  23:pe-mcollective         ########################################### [ 58%]
  24:pe-mcollective-client  ########################################### [ 60%]
  25:pe-rubygem-stomp-doc   ########################################### [ 63%]
  26:pe-ruby-augeas         ########################################### [ 65%]
  27:pe-ruby-ldap           ########################################### [ 68%]
  28:pe-ruby-ri             ########################################### [ 70%]
  29:pe-mod_ssl             ########################################### [ 73%]
  30:pe-memcached           ########################################### [ 75%]
  31:pe-libevent            ########################################### [ 78%]
  32:pe-activemq            ########################################### [ 80%]
  33:pe-puppet-dashboard    ########################################### [ 83%]
  34:pe-rubygem-sinatra     ########################################### [ 85%]
  35:pe-console-auth        ########################################### [ 88%]
  36:pe-rubygem-ar-extension########################################### [ 90%]
  37:pe-rubygem-dalli       ########################################### [ 93%]
  38:pe-live-management     ########################################### [ 95%]
  39:pe-puppet-dashboard-bas########################################### [ 98%]

  40:pe-rubygem-tilt        ########################################### [100%]
## Setting up puppet master...
## Checking the agent certificate name detection...
## Setting up puppet agent...
## Setting up the console...
## Starting http server for puppet master and console.
## Creating symbolic links in "/usr/local/bin"...
Generating collective password...
Running puppet apply to configure MCollective ...
MCollective configuration is complete ...

-------------------------------------------------------------------------------------------------------------------------------------------------

STEP 4: DONE

Thanks for installing Puppet Enterprise!
   Puppet Enterprise has been installed to "/opt/puppet," and its configuration files are located in "/etc/puppetlabs".
## Answers from this session saved to './answers.lastrun.mt-olinux64-b03'

=================================================================================================================================================

The console can be reached at the following URI:

   If you have a firewall running, please ensure the following TCP ports are open: 8140, 61613, 443
   WARNING: This system has 8388608 bytes allocated for MySQL's innodb_buffer_pool_size, which is below the recommended minimum of 80 MB.
   Although this node will be a fully functional console, it may experience problems with database migrations during upgrades. Increasing the
   buffer pool size as described at http://links.puppetlabs.com/innodb_buffer_pool_size will help avoid this problem.

# answer.install for unattended Puppet Enterprise Master installation

[root@linux64-puppet-server ~]# cat /etc/puppetlabs/installer/answers.install
q_install=y
q_puppet_cloud_install=n
q_puppet_enterpriseconsole_auth_database_name=console_auth
q_puppet_enterpriseconsole_auth_database_password=********
q_puppet_enterpriseconsole_auth_database_user=console_auth
q_puppet_enterpriseconsole_auth_password=********
q_puppet_enterpriseconsole_auth_user_email=pptadmin@domain.com
q_puppet_enterpriseconsole_database_install=n
q_puppet_enterpriseconsole_database_name=console
q_puppet_enterpriseconsole_database_password=********
q_puppet_enterpriseconsole_database_remote=n
q_puppet_enterpriseconsole_database_root_password=root
q_puppet_enterpriseconsole_database_user=console
q_puppet_enterpriseconsole_httpd_port=443
q_puppet_enterpriseconsole_install=y
q_puppet_enterpriseconsole_inventory_hostname=linux64-puppet-server.domain.com
q_puppet_enterpriseconsole_inventory_port=8140
q_puppet_enterpriseconsole_master_hostname=linux64-puppet-server.domain.com
q_puppet_enterpriseconsole_setup_db=y
q_puppet_enterpriseconsole_smtp_host=smtp.domain.com
q_puppet_enterpriseconsole_smtp_password=
q_puppet_enterpriseconsole_smtp_port=25
q_puppet_enterpriseconsole_smtp_use_tls=n
q_puppet_enterpriseconsole_smtp_user_auth=n
q_puppet_enterpriseconsole_smtp_username=
q_puppet_symlinks_install=y
q_puppetagent_certname=linux64-puppet-server.domain.com
q_puppetagent_install=y
q_puppetagent_server=linux64-puppet-server.domain.com
q_puppetca_install=y
q_puppetmaster_certname=linux64-puppet-server.domain.com
q_puppetmaster_dnsaltnames=linux64-puppet-server,linux64-puppet-server.domain.com,puppet,puppet.domain.com
q_puppetmaster_enterpriseconsole_hostname=localhost
q_puppetmaster_enterpriseconsole_port=443
q_puppetmaster_forward_facts=n
q_puppetmaster_install=y
q_vendor_packages_install=n

# Puppet Enterprise Agent

[root@linux64-puppet-agent ~]# cd /opt
[root@linux64-puppet-agent opt]# tar zxvf puppet-enterprise-2.5.0-el-5-x86_64.tar.gz[root@linux64-puppet-agent ~]# rpm –Uvh /opt/puppet-enterprise-2.5.0-el-5-x86_64/packages/el-5-x86_64/pe-virtual-java-1.0-1.pe.el5.noarch.rpm

# make sure puppet prerequisites get installed

[root@linux64-puppet-agent ~]# cd puppet-enterprise-2.5.0-el-5-x86_64
[root@linux64-puppet-agent puppet-enterprise-2.5.0-el-5-x86_64
]# ./puppet-enterprise-installer
=================================================================================================================================================

Puppet Enterprise v2.5.0 installer

Puppet Enterprise documentation can be found at http://links.puppetlabs.com/puppet_enterprise_2.5_documentation

-------------------------------------------------------------------------------------------------------------------------------------------------

STEP 1: SELECT AND CONFIGURE ROLES

   This installer will offer to install the puppet master, console, cloud provisioner, and puppet agent roles.

-> puppet master

   The puppet master serves configurations to a group of puppet agent nodes. This role also provides MCollective's message queue and client
   interface. It should be installed on a robust, dedicated server.

?? Install puppet master? [y/N]

-> cloud provisioner

   The cloud provisioner can create and bootstrap new machine instances and add them to your Puppet infrastructure. It should be installed on
   a trusted node where site administrators have shell access.

?? Install the cloud provisioner? [y/N]

-> console

   The console is a web interface for viewing reports, classifying nodes, directly managing resources, controlling Puppet runs, and invoking
   MCollective agents. It should usually be installed on the puppet master server, but can also installed separately.

?? Install the console? [y/N]

-> puppet agent

   The puppet agent applies configurations from the puppet master and submits reports and inventory information. It should be installed on
   every node you plan to manage with Puppet.

?? Install puppet agent? [Y/n]
?? Puppet agent needs a unique name ("certname") for its certificate; this can be an arbitrary string. Certname for this node? [Default:
   linux64-puppet-agent] linux64-puppet-agent.domain.com
?? Puppet master hostname to connect to? [Default: puppet]
?? The installer couldn’t reach the puppet master server at puppet. If this server name is correct, please check your DNS configuration to

   Enter ‘r’ if you need to re-enter the puppet master’s name; otherwise, enter ‘c’ to continue. [c/r] r
?? Puppet master hostname to connect to? [Default: puppet] linux64-puppet-server.domain.com

-> Convenience Links

   The selected Puppet software will be installed into "/opt/puppet", which may not be included in your default shell PATH. For ease of use,
   this installer can create symbolic links to these executables in "/usr/local/bin".

?? Create symbolic links to Puppet executables in "/usr/local/bin"? [Y/n]

-------------------------------------------------------------------------------------------------------------------------------------------------

STEP 2: CONFIRM PLAN

You have selected to install the following components (and their dependencies)
* Puppet Agent

?? Perform installation? [Y/n]
## Saved answers to file: ./answers.lastrun.linux64-puppet-agent

=================================================================================================================================================
## Saved answers to file: /etc/puppetlabs/installer/answers.install
Created: /etc/puppetlabs/facter/facts.d

-------------------------------------------------------------------------------------------------------------------------------------------------

STEP 3: INSTALL PACKAGES

## Installing packages from files...
Preparing...                ########################################### [100%]
   1:pe-puppet-enterprise-re########################################### [  5%]
   2:pe-ruby-libs           ########################################### [ 10%]
   3:pe-ruby                ########################################### [ 15%]
   4:pe-facter              ########################################### [ 20%]
   5:pe-ruby-irb            ########################################### [ 25%]
   6:pe-ruby-rdoc           ########################################### [ 30%]
   7:pe-rubygems            ########################################### [ 35%]
   8:pe-rubygem-stomp       ########################################### [ 40%]
   9:pe-mcollective-common  ########################################### [ 45%]
  10:pe-ruby-shadow         ########################################### [ 50%]
  11:pe-puppet              ########################################### [ 55%]
  12:pe-rubygem-hiera       ########################################### [ 60%]
  13:pe-augeas-libs         ########################################### [ 65%]
  14:pe-augeas              ########################################### [ 70%]
  15:pe-mcollective         ########################################### [ 75%]
  16:pe-ruby-augeas         ########################################### [ 80%]
  17:pe-rubygem-hiera-puppet########################################### [ 85%]
  18:pe-rubygem-stomp-doc   ########################################### [ 90%]
  19:pe-ruby-ldap           ########################################### [ 95%]
  20:pe-ruby-ri             ########################################### [100%]
## Checking the agent certificate name detection...
## Setting up puppet agent...
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
## Creating symbolic links in "/usr/local/bin"...

-------------------------------------------------------------------------------------------------------------------------------------------------

STEP 4: DONE

Thanks for installing Puppet Enterprise!
   Puppet Enterprise has been installed to "/opt/puppet," and its configuration files are located in "/etc/puppetlabs".
## Answers from this session saved to './answers.lastrun.mt-olinux64-b04'

=================================================================================================================================================

   If you have a firewall running, please ensure outbound connections to linux64-puppet-server.domain.com are allowed via the following TCP ports:
   8140, 61613

# answer.install for unattended Puppet Enterprise Agent installation 

[root@linux64-puppet-agent ~]# cat /etc/puppetlabs/installer/answers.install
q_fail_on_unsuccessful_master_lookup=y
q_install=y
q_puppet_cloud_install=n
q_puppet_enterpriseconsole_install=n
q_puppet_symlinks_install=y
q_puppetagent_certname=linux64-puppet-agent.domain.com
q_puppetagent_install=y
q_puppetagent_server=linux64-puppet-server.domain.com
q_puppetca_install=n
q_puppetmaster_install=n
q_vendor_packages_install=n

# Troubleshooting for Puppet Enterprise Live Management on Red Hat 5

broker.ts (default path /etc/puppetlabs/activemq/broker.ts) should not exist on Puppet Enterprise Master host

[root@linux64-puppet-server ~]# uname -a
Linux linux64-puppet-server 2.6.32-100.0.19.el5 #1 SMP Fri Sep 17 17:51:41 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@linux64-puppet-server ~]# crontab -l
# HEADER: This file was autogenerated at Thu Apr 19 16:31:46 -0400 2012 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: pe-mcollective-metadata
0,15,30,45 * * * * /opt/puppet/sbin/refresh-mcollective-metadata
# Puppet Name: report_baseline
0 20 * * * PATH=/opt/puppet/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin /opt/puppet/bin/puppet inspect
3 * * * * /opt/puppet/remove_broker_ts.sh

[root@linux64-puppet-server ~]# cat /opt/puppet/remove_broker_ts.sh
#!/bin/sh

if [ -e "/etc/puppetlabs/activemq/broker.ts" ]; then
   /bin/rm -f /etc/puppetlabs/activemq/broker.ts
   service pe-activemq start
fi

# Puppet Enterprise Console

# Puppet Enterprise Live Management



Saturday, March 31, 2012

MySQL: Convert MySQL DB characte set latin1 to utf8

Steps for converting JIRA MySQL DB character set latin1 to utf8:

JIRA's XML backup utility to backup JIRA database in XML format

Administration -> System -> Import & Export -> Backup System -> Backup JIRA data


# develop a Perl script (mysql_latin1_2_utf8.pl) to use ALTER TABLE/DATABASE SQL statements to convert data from latin1 to utf8

# automatically convert all text columns to utf8

ALTER TABLE <table_name> CONVERT TO CHARACTER SET utf8;

# for any future tables created in this database will use utf8 by default

ALTER DATABASE <database_name> CHARACTER SET utf8;

# mysql_latin1_2_utf8.pl usage

NAME
       mysql_latin1_2_utf8.pl
SYNOPSIS
       DESCRIPTION

       This script is going to convert MySQL database characte set from latin1 to utf8.
       VERSION
       Version 1.0
       USAGE
          perl mysql_latin1_2_utf8.pl --mysql_dbname "[mysql_dbname]" --mysql_username "[mysql_username]" --mysql_password "[mysql_password]" --mysql_host "[mysql_host]"
       ·   --mysql_dbname "[mysql_dbname]" - MySQL dbname. Required
       ·   --mysql_username "[mysql_username]" - MySQL username. Required
       ·   --mysql_password "[mysql_password]" - MySQL password. Option
       ·   --mysql_host "[mysql_host]" - MySQL host. Required
       EXAMPLE
          1. convert MySQL database characte set from latin1 to utf8.
          perl /tmp/mysql_latin1_2_utf8.pl --mysql_dbname "latin1jiradb" --mysql_username "root" --mysql_password "********" --mysql_host "linux64-jira-server"

# stop jira service

[root@linux64-jira-server ~]# service jira stop

# execute MySQL utf8 convertion

[root@linux64-jira-server ~]# perl /tmp/mysql_latin1_2_utf8.pl --mysql_dbname "latin1jiradb" --mysql_username "root" --mysql_password "********" --mysql_host "linux64-jira-server"

# restart mysql service

[root@linux64-jira-server ~]# service mysql restart

# start jira service

[root@linux64-jira-server ~]# service jira start

Sunday, March 11, 2012

JIRA: cascading select fields

Open Internet Explorer with JIRA admin login


"%ProgramFiles%\Internet Explorer\iexplore.exe"
"http://<my_jira_server>:8080/secure/admin/EditCustomFieldOptions!add.jspa?fieldConfigId=<fieldConfigId>&selectedParentOptionId=&addSelectValue=true&addValue=<Parent_Value>"


"%ProgramFiles%\Internet Explorer\iexplore.exe"
"http://<my_jira_server>:8080/secure/admin/EditCustomFieldOptions!add.jspa?fieldConfigId=<fieldConfigId>&selectedParentOptionId=<selectedParentOptionId>&addSelectValue=true&addValue=<Child_Value>"


To find those IDs, click 'Configure' on the custom field, then 'Edit Options' to get to the EditCustomFieldOptions!default.jspa page. The URL will have a fieldConfigId parameter, and its value is what you enter here.
On the EditCustomFieldOptions page, add a value, then click 'Delete' alongside it and examine the URL, which will be EditCustomFieldOptions!remove.jspa?fieldConfigId=...&selectedValue=..., The 'selectedValue' is what to enter here.

"%ProgramFiles%\Internet Explorer\iexplore.exe" "http://<my_jira_server>:8080/secure/admin/EditCustomFieldOptions!add.jspa?fieldConfigId=10704&selectedParentOptionId=&addSelectValue=true&addValue=third"

"%ProgramFiles%\Internet Explorer\iexplore.exe" "http://<my_jira_server>:8080/secure/admin/EditCustomFieldOptions!add.jspa?fieldConfigId=10704&selectedParentOptionId=11619&addSelectValue=true&addValue=second"


Saturday, February 25, 2012

Enterprise Linux: Local Yum Repository

Steps to create a Local Yum Repository for Puppetlabs Puppet Open Source on Red Hat 5

# Red Hat 5

[root@linux64-yum-repo-server ~]# uname -a
Linux linux64-yum-repo-server 2.6.18-194.el5 #1 SMP Mon Mar 29 22:10:29 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

# Puppetlabs yum.repo config file

[root@linux64-yum-repo-server ~]# cat /etc/yum.repos.d/puppetlabs.repo
[puppetlabs]
name=Puppet Labs Packages
baseurl=http://yum.puppetlabs.com/el/5/products/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
[puppetlabs_dependencies]
name=Puppet Labs Packages
baseurl=http://yum.puppetlabs.com/el/5/dependencies/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs

# install Apache httpd

[root@linux64-yum-repo-server ~]# yum install httpd
[root@linux64-yum-repo-server ~]# chkconfig httpd on
[root@linux64-yum-repo-server ~]# /etc/init.d/httpd start
Starting httpd:                                            [  OK  ]

# install yum-utils, createrepo 

[root@linux64-yum-repo-server ~]# yum install yum-utils createrepo

# get a temp copy of puppetlabs, puppetlabs_dependencies RPMS

[root@linux64-yum-repo-server ~]# reposync -r puppetlabs
puppetlabs                                                                                                              
[root@linux64-yum-repo-server yum.repos.d]# reposync -r puppetlabs_dependencies

# create Local Yum Repository folder structure

[root@linux64-yum-repo-server ~]# mkdir -p /var/www/html/puppet/el/5/products/x86_64

# move the temp local copy of RPMs into local yum repository folder

[root@linux64-yum-repo-server ~]# mv /root/puppetlabs/* /var/www/html/puppet/el/5/products/x86_64/ 
[root@linux64-yum-repo-server ~]# mkdir -p /var/www/html/puppet/el/5/dependencies/x86_64/
[root@linux64-yum-repo-server ~]# mv /root/puppetlabs_dependencies/* /var/www/html/puppet/el/5/dependencies/x86_64/

# create Local Yum Repository 

[root@linux64-yum-repo-server ~]# cd /var/www/html/puppet/el/5/products/x86_64/
[root@linux64-yum-repo-server x86_64]# createrepo -u http://linux64-yum-repo-server/puppet/el/5/products/x86_64/ -d .
80/80 - puppetlabs-release-5-1.noarch.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@linux64-yum-repo-server ~]# cd /var/www/html/puppet/el/5/dependencies/x86_64/ 
[root@linux64-yum-repo-server x86_64]# createrepo -u http://linux64-yum-repo-server/puppet/el/5/dependencies/x86_64/ -d .
24/24 - rubygem-stomp-doc-1.2.2-1.el5.noarch.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@linux64-yum-repo-server ~]# ls -al /var/www/html/puppet
total 16
drwxr-xr-x 3 root root 4096 Feb  5 17:09 .
drwxr-xr-x 4 root root 4096 Feb  5 17:02 ..
drwxr-xr-x 3 root root 4096 Feb  5 16:57 el
-rw-r--r-- 1 root root 1711 Feb  5 17:11 RPM-GPG-KEY-puppetlabs

# Local Yum Repository Web



# generate Local Yum Repository associated yum.repo config file 

[root@linux64-yum-repo-server ~]# cat /etc/yum.repos.d/ puppetlabs.repo
[puppetlabs]
name=(local yum repo of) Puppet Labs Packages
baseurl=http://linux64-yum-repo-server/puppet/el/5/products/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://linux64-yum-repo-server/puppet/RPM-GPG-KEY-puppetlabs
[puppetlabs_dependencies]
name=(local yum repo of) Puppet Labs Packages
baseurl=http://linux64-yum-repo-server/puppet/el/5/dependencies/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://linux64-yum-repo-server/puppet/RPM-GPG-KEY-puppetlabs

# get Yum Repository List

[root@linux64-yum-repo-server ~]# yum repolist
Loaded plugins: security
repo id                                     repo name                                                                              status
el5_u5_base                                 Enterprise Linux 5 Update 5 installation media copy (x86_64)                           enabled: 4,372
puppetlabs                                  (local yum repo of) Puppet Labs Packages                                               enabled:    80
puppetlabs_dependencies                     (local yum repo of) Puppet Labs Packages                                               enabled:    24
repolist: 13,726

Saturday, February 18, 2012

JIRA security: Anonymous user access

Make sure JIRA Anonymous user has read only access

1. JIRA: Administration -> Issues -> Permission Schemes -> bla bla Schemes -> Permissions -> Browse Projects, Add -> Group (Anyone)
2. Within JIRA project associated Workflow:
All of Transitions has conditions: Only users in group jira-users can execute this transition
3. without login into JIRA, browsing http://<MY_JIRA_SERVER>:8080/browse/<MY_JIRA_PROJECT_KEY>-123 will see below Login button

Saturday, February 11, 2012

JIRA migration: BugZilla multi-line desc/comments

BugZilla MySQL database

The longtext table contains each bug_id's associated multi-line desc and multi-line comments.


MySQL query to get bug_id and the text result

SELECT 

    bug_id
    , thetext
FROM
    bugs.longdescs as T1
where
    T1.bug_id in (SELECT 
           bug_id
        FROM
            bugs.bugs
        where
            product_id in (SELECT 
                    id
                FROM
                    bugs.products
                where
                    (name like 'MY_BUGZILLA_PROJECT')))
Order by T1.bug_id
For each of bug_ids associated multi-line thetext entries: 
First entry is the bug_id associated desc
Remaining entries (if existed) are the bug_id associated comments.


Migrate BugZilla multi-line desc & comments into JIRA

1. create a BugZilla query for JIRA migration without multi-line desc/comments
2. JIRA, Administration -> System -> Import & Export -> Import External projects -> CSV Import
3. create a MySQL query to only contains bug ids, and save the query result as XML format

SELECT 
    bug_id
FROM
    bugs.bugs
where
    product_id in (SELECT 
            id
        FROM
            bugs.products
        where
            (name like ' MY_BUGZILLA_PROJECT ')))
Order by bug_id
4. run a PERL script (i.e. xmlBugIdExportIntoJIRA.pl) through JIRA cli interface updating desc/comments on Linux platform from where BugZilla's desc/comments UTF-8 code issue will be solved)

NAME

    xmlBugIdExportIntoJira.pl

SYNOPSIS

  DESCRIPTION

    This script is going to migrate exported XML format from BugZilla MySQL with bug_id, thetext file into Jira.

  VERSION

    Version 1.0

  USAGE

       perl xmlBugIdExportIntoJira.pl --jira_project_key "[jira_project_key]" --jira_field_for_bug_id "[jira_field_for_bug_id]" --jira_field_for_bugzilla_thetext "[jira_field_for_bugzilla_thetext]" --exported_xml_format_bugzilla_mysql_id_description_file "[exported_xml_format_bugzilla_mysql_id_description_file]" --jira_cli "[jira_cli]"
    *   --jira_project_key "[jira_project_key]" - Jira Project Key. *Required*
    *   --jira_field_for_bug_id "[jira_field_for_bug_id]" - Jira field maps to bug_id field. *Required*
    *   --jira_field_for_bugzilla_thetext="[jira_field_for_bugzilla_thetext]" - Jira field maps to bug_id Description field. *Required*
    *   --exported_xml_format_bugzilla_mysql_id_description_file "[exported_xml_format_bugzilla_mysql_id_description_file]" - Fullpath of exported xml format BugZilla MySQL bug_id file. *Required*
    *   execute MySQL query SELECT bug_id FROM bugs.bugs where product_id=(SELECT id FROM bugs.products where name = "MY_BUGZILLA_PROJECT" and save the results into xml
        SELECT bug_id, thetext FROM bugs.longdescs as T1 where T1.bug_id = id Order By bug_when
    *   --jira_cli "[jira_cli]" - Full path of atlassian-cli. *Required*

  EXAMPLE

       1. Migrate exported XML format BugZilla bug_id, thetext file into Jira.
       perl /tmp/xmlBugIdExportIntoJira.pl --jira_project_key "MY_JIRA_PROJECT_KEY" --jira_field_for_bug_id "bug_id" --jira_field_for_bugzilla_thetext "description" --exported_xml_format_bugzilla_mysql_id_description_file /tmp/BugZilla_MySQL_id_longdescs.xml --jira_cli /opt/atlassian-cli-2.4.0/jira.sh

Saturday, February 4, 2012

Enterprise Linux: CollabNet Subversion Edge

# get CollabNetSubversionEdge

Download CollabNetSubversionEdge-2.2.1_linux-x86_64.tar.gz from http://www.open.collab.net/downloads/subversion/

CollabNet Subversion Edge 2.2.1 (for Linux 64 bit)
   License: GNU Affero General Public License 3.0 (AGPLv3)
   Certified platforms: Red Hat Enterprise Linux 5.x
                        Red Hat Enterprise Linux 6.x
                        CentOS 5.x
                        SuSE Linux Enterprise 11.x
   NOTE: These are the platforms we formally certify when testing.  CollabNet
   Subversion Edge is known to work on virtually all Linux distributions and is
   informally tested on others such as Ubuntu and Fedora.
  
   Requirements
   * Java 1.6 JRE/JDK must be installed. We recommend the JRE provided by
     Sun/Oracle.  When testing on 64-bit Linux we have used the 64-bit JVM.
   * Python 2.4 to 2.6 must be installed.

# Java 1.6

[root@linux64-svn-server ~]# rpm -Uvh /tmp/ jdk-6u23-linux-amd64.rpm
[root@linux64-svn-server ~]# echo "export JAVA_HOME=/usr/java/jdk1.6.0_23" >> /etc/profile
[root@linux64-svn-server ~]# source /etc/profile

# Python version

[root@linux64-svn-server ~]# python –V
Python 2.4.3

# extract CollabNetSubversionEdge tar.gz using none root, sudo user

[root@linux64-svn-server ~]# useradd csvn
[root@linux64-svn-server ~]# su - csvn
[csvn@linux64-svn-server ~]$ chmod a+x /tmp/CollabNetSubversionEdge-2.2.1_linux-x86_64.tar.gz
[csvn@linux64-svn-server ~]$ tar zxf /tmp/CollabNetSubversionEdge-2.2.1_linux-x86_64.tar.gz
[csvn@linux64-svn-server ~]$ exit # as root now
[root@linux64-svn-server ~]# cp –pr /tmp/csvn /opt
[root@linux64-svn-server ~]# cd /opt/csvn/bin
[root@linux64-svn-server bin]# ./csvn install
Detected RHEL or Fedora:
Installing the CSVN Console daemon..
Setting RUN_AS_USER to: 'root'. Please edit '../data/conf/csvn.conf' if this needs to be adjusted
Setting JAVA_HOME to: '/usr/java/jdk1.6.0_23'. Please edit '../data/conf/csvn.conf' if this needs to be adjusted.
./csvn start
Starting CSVN Console......
CSVN Console started
Waiting for application to initialize (this may take a minute).................
CSVN Console is ready at http://localhost:3343/csvn
./csvn-httpd install
Detected RHEL or Fedora:
Installing the Subversion Edge Apache Server daemon..
./csvn-httpd start
Starting Subversion Edge Apache Server:                    [  OK  ]

# change port from 18080 to 443 or 80

[root@linux64-svn-server ~]# chown root:csvn /opt/csvn/lib/httpd_bind/httpd_bind
[root@linux64-svn-server ~]# chmod u+s /opt/csvn/lib/httpd_bind/httpd_bind

# make sure csvn has access permission for repositories

[root@linux64-svn-server ~]# chown –R csvn /opt/csvn/data/repositories

# http://localhost:4434/csvn