jueves, 13 de octubre de 2011

Agregar los repositorio a chef

SEGUNDO GRAN PASO: Agregar los repositorios, entiendase cookbooks, templates ...
Lo primero es tener instalado git para poder jalar el repo de ospcode:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:git-core/ppa
sudo aptitude update
sudo aptitude safe-upgrade
sudo aptitude install git

Git es necesario, dado que el comando knife cookbook funciona usando git, es una ventaja ademas, tener los cookbooks en un repositorio con versiones de control. Crea un repositorio en GitHub donde almacenaras tus cookbooks, y dale los permisos necesarios para acceder desde tu chef-master. Crea en el chef-master las llaves para autenticar con el repo github.

ssh-keygen -t dsa

Asegura que la carpeta /var/chef/cookbooks (donde por defecto van los cookbooks) pertenezca al usuario que modificará los mismo

sudo chown luis:luis -R cookbooks

Inicializa un repositorio git:

git config --global user.name "Luis García Acosta"
git config --global user.email luis@springstar.com
git init
git add README
git commit -m 'first commit'
git remote add origin git@github.com:lgarciaac/springstar-cookbooks.git
git push -u origin master

Una ves logrado esto, chef y hithub están configurados para gozar de las bondades de chef, puedes empezar a agregar tus propios repositorios o repositorios publicos que se encuentran en http://community.opscode.com/cookbooks. En mi caso, no me pueden faltar ni mysql, ninginx ni apt

knife cookbook site install mysql
knife cookbook site install nginx
knife cookbook site install apt

Despues, basta con un simple push para manterner todo en HitHub

Una vez descargados los cookbooks, hay que subirlos al chef-server.

knife cookbook upload munin ó knife cookbook upload -a (sube todos los cookbooks respetando las dependencias)

Si este depende de otros cookbooks, va a protestar y a pedirlo antes

miércoles, 12 de octubre de 2011

Como instalar chef server en ubuntu

Como instalar chef master me ha dado tantos dolores de cabeza, creo que lo mejor es dejar un record de lo que he echo, tanto para mi como para otras personas. La instalación va a ser a travez de apt-get, por por gem


Entorno:

Ubuntu 10.04, instalación totalmente nueva solo ssh server como extra pakete


Actualizar la paqueteria de Ubuntu

sudo apt-get update; sudo apt-get upgrade


Agregar el reposito de Ospcode como se refleja en http://wiki.opscode.com/display/chef/Installing+Chef+Server+on+Debian+or+Ubuntu+using+Packages

sudo touch /etc/apt/sources.list.d/opscode.list
sudo echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list


Agregar el GPG Key y upgradear el indice

sudo mkdir -p /etc/apt/trusted.gpg.d
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
gpg --export packages@opscode.com | sudo tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
sudo apt-get update
sudo apt-get install opscode-keyring

Instalar chef y chef-server. Este paso descargará cerca de 200Mb, instalará RabbitMQ, CouchDB, Chef Server apies, Chef Server UI, en fin, todo lo que necesitamos :-)


Siguiendo las instrucciones de la referencia todo debe de marchar bien. Ademas del .pem para el cliente, se tiene que copiar el validator.pem

domingo, 2 de octubre de 2011

viernes, 19 de agosto de 2011

How to use Telnet to send email over Port 25 using SMTP

Telnet: TELNET (TELetype NETwork) is a network protocol used on the Internet or local area network (LAN) connections. It was developed in 1969 and standardized as IETF STD 8, one of the first Internet standards.

SMTP: Simple Mail Transfer Protocol (SMTP) is the de facto standard for e-mail transmissions across the Internet.


Step # 1: First, open a command prompt. To open a command prompt window, click Start, Run and then type in cmd and press Enter. You can also press the +R to open the Run prompt and then type in cmd in the open text box.

Step # 2: You need to know a remote mail server. If you are still in school or working, there is the excellent opportunity to use your University mail server or your company’s mail server for this.

type in telnet RemoteMailServer 25 at the command prompt. The Remote mail server here in this command is the mail server of your school or company. It is usually mailhost..edu or compmail..com or something on those lines. When you press enter, you are shown a quick prompt that you are connecting to the remote mail server.

Step # 3: Introduce yourself to the mail server. Play around a bit.
type in helo mailhost at the command prompt. The mail server responds back with something like this

250 RemoteMailHost. Hello , pleased to meet you.

Step # 4: You can now enter your email address.
type in mail from: your email id @ blah.com
The mail server responds back with a 250 … sender ok

Step # 5: You can now enter your receipient’s email address
type in rcpt to: recipient email id @ blah.com
The mail server responds back with a “Recipient OK” message

Step # 6: Now, you are ready to type in the body of the email message.
type in data and press enter.
Now, type your message and then finally press Enter. To end your message type in a single period “.” . Your message is now in the queue

Step # 7: To complete and finish the process, type in quit and press enter. The mail server responds with a “Bye” after which you see a “Connection to host lost” message displayed.

martes, 19 de julio de 2011

Instalar Git server Ubuntu, con ssh-key

http://fclose.com/b/linux/1432/setting-up-git-server-using-gitosis/
http://fclose.com/b/linux/1434/managing-repositories-on-git-server-using-gitosis/
https://help.ubuntu.com/community/Git

Si da problemas pidiendo passwords:
http://www.baptiste-wicht.com/2010/07/tip-how-to-solve-agent-admitted-failure-to-sign-using-the-key-error/

Instalar passenger

sudo gem install passenger
sudo passenger-install-apache2-module

El segundo comando larga una serie de validaciones, es muy instuitivo de seguir. Luego hay que  modificar la configuracion del apache. Algo más o menos así debe ser escrito (seguir las instrucciones del passenger-install-apache2-module, estas son un ejemplo)

LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.11
PassengerRuby /opt/local/bin/ruby


Por último, crear un virtual host:

   <VirtualHost *:80>
      ServerName www.yourhost.com
      DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
      <Directory /somewhere/public>
         AllowOverride all              # <-- relax Apache security settings
         Options -MultiViews            # <-- MultiViews must be turned off
      </Directory>
   </VirtualHost>



CREANDO  MAS DE UNS PROYECTO, CORRIENDOLOS CON DIFERENTES RUBY/GEM VERSIONES


Se