The setup was performed on a freshly installed CentOS 6 VM using a “minimal ISO” image from the CentOS Project website. The VM was set up on a local VirtualBox installation, all settings being left to default except for the memory which was increased from 512Mb to 1Gb. Of course, the more, the better, but 1Gb is the lowest one can go without facing serious memory swapping.
The successful Centos 6 installation leaves the external network interface disabled upon the initial boot, so this must be fixed before anything else. One must look into /etc/sysconfig/network-scripts/ifcfg-eth0 and change the ONBOOT parameter from no to yes. Afterwards, the network subsystem must be restarted, e.g.:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 ... ONBOOT=yes ... # service network restart
Once the VM gets Internet access, it’s a good practice to update everything and reboot it before going forward with the Chef Server installation:
# yum -y update # reboot
There is one important change one must perform in order to get the Chef Server properly set up: the hostname, as localhost.localdomain won’t do. The hostname must also be associated to a static IP address, which can be achieved in VirtualBox by playing with some networking settings (not presented here).
Inside the VM, this is easy to put in place:
This text is about automating the interaction with Atlassian Confluence, a commercial product widely used in the corporate world for publishing documentation or other content that needs sharing with a certain team, department or throughout the whole organization. This product is usually integrated with the other Atlassian tools such as Bamboo or JIRA.
By “automating the interaction” I understand document publishing; one may extract data from other components of the system using automated tools and may want this data published in a nice format (if possible). This is indeed possible through the REST interface that Atlassian provides for all its products. The REST functionality does not cover all the features or functions, though, but it’s enough for our scenario. The reference for the Confluence Cloud version can be found here. Please note that the interface may be a bit different between versions, so please check the API reference for your particular Confluence version.
Now that we have the tools and the method, let’s get to the implementation – and obviously, to some code.
The big data repository known as Chef Server is manipulated with a tool called knife. The general (simplified) syntax for this tool is:
$ knife category command item
The category can be one of: environment, client, node, data bag, cookbook, … The full list can be found here.
The command (usually) is one of create, list, show, edit or delete. There are more commands, though, depending on what is being requested through knife.
On the cheat sheat itself, let’s start with some classics: