29 Apr

It’s official! Pentaho Reporting video course for Packt Publishing Limited

packt-publishing

I am going to start to develop the Pentaho Reporting video course for Packt Publishing Limited a modern publishing company, producing cutting-edge books, eBooks, and articles for communities of developers, administrators, and newbies alike.

Pentaho Reporting 3.5 for Java DevelopersThe video course is mainly based on the Pentaho Reporting 3.5 for Java Developers book, will be composed by 8 different sections, more than 40 videos and will have 2 hours (circa) of duration.

Interesting experience!

01 Apr

Deploy, manage, and orchestrate computer systems with Ansible

Are you bored on installing each time a new environment fron scratch loosing hours and hours and hours and hours…

Start in minutes and do not repeat yourself!

Ansible is a radically simple IT orchestration solution that automates configuration, software deployment, and other IT needs. Ansible models your IT infrastructure by looking at the comprehensive architecture of how all of your systems inter-relate, rather than just managing one system at a time. It uses no agents and no additional custom security infrastructure, so it’s exceedingly easy to deploy — and most importantly, it uses a very simple language (called playbooks) that allows describing your automation in plain English, rather than writing things that have the complexity of software code. By using Ansible, you’ll be faster at automating your IT, but also be able to achieve new capabilities you haven’t been able to before.

ansible-logo

In this post is described how to prepare a concrete architecture where you can develop, more or less, everything as starting point of every work. The architecture is composed by two virtual machines: an Ansible server and a target server. Of course you can use phisical servers, in house or cloud, simply accessing them using ssh.

The role of the Ansible server is to manage the scripts (called playbooks) for the configuration, software deployment, and other IT needs on the target server. Very important is to underline that every activity with Ansible is idempotent. This means that executing the activities multiple times, the result is always the same.

Preparing the Ansible server

First of all let’s prepare the Ansible server using Oracle Virtual Box.

Create a new virtual machine with 512Mb RAM and 8Tb of space. The connection to the LAN should be “bridged” to let the server be visible.

Start the brand new virtual machine installing XUbuntu 12.10. In this evnironment is used XUbuntu instead of Ubuntu because it’s more light with the same features and capabilities.

During the installation create the user ‘ansible’ we will use as manager of the installation on the target server.

After all, reboot the system as requested to complete the installation.

Login as ansible user and open a terminal executing:

sudo add-apt-repository ppa:rquillo/ansible
sudo apt-get update
sudo apt-get upgrade

It’s suggested to reboot the system more times and execute the upgrade again. Finally:

sudo apt-get install ansible

Ansible it’s now succesfully installed!

Let’s configure the ssh key to make easier the connection to the target server.

ssh-keygen -t rsa
...: /home/ansible/.ssh/id_rsa
...: no passphrase
ssh-agent bash
ssh-add ~/.ssh/id_rsa

Now your Ansible server is ready!

Preparing the target server

Create a new virtual machine with the connection to the LAN “bridged” to let the server be reachable.

Start the brand new virtual machine installing XUbuntu 12.10. During the installation create the user ‘ansible’ we will use as manager of the installation. After all, reboot the system as requested to complete the installation.

Login as ansible user and open a terminal executing:

sudo apt-get update
sudo apt-get upgrade

It’s suggested to reboot the system more times and execute the upgrade again. Finally install the ssh server to let the Ansible server connect.

sudo apt-get install openssh-server
mkdir /home/ansible/.ssh

Configuring the Ansible server to connect to the target server

As ansible user on the Ansible server, open a terminal and execute.

cd /home/ansible/.ssh
scp id_rsa.pub ansible@<ip of the target server>:/home/ansible/.ssh
scp id_rsa.pub ansible@<ip of the target server>:/home/ansible/.ssh/authorized_keys

Let’s configure the Ansible server to work on the target server.

sudo chown ansible:ansible /etc/ansible/hosts
nano /etc/ansible/hosts

Add this group at the end of file.

[TargetServers]
<ip of the target server>

Now it’s time to connect to the target server from the Ansible server.

ssh ansible@<ip of the target server>

IMPORTANT: this command should open an ssh session without asking any password.

Now that everything is well configured let’s test the connection using ansible.

ansible TargetServers -m ping -u ansible

With the result:

<ip of the target server> | success >> {
    "changed": false,
    "ping": "pong"
}

Enjoy with Ansible…