Created
July 8, 2014 17:50
-
-
Save kafecho/2ba793c53f1c0cb15eca to your computer and use it in GitHub Desktop.
Ansible playbook to install CouchDB from source on CentOS 6.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: cd-servers | |
gather_facts: no | |
sudo: true | |
user: deploy | |
tasks: | |
- name: Install Couchdb dependencies | |
yum: name={{ item }} state=installed | |
with_items: | |
- autoconf | |
- autoconf-archive | |
- automake | |
- curl-devel | |
- erlang-asn1 | |
- erlang-erts | |
- erlang-eunit | |
- erlang-os_mon | |
- erlang-xmerl | |
- help2man | |
- js-devel | |
- libicu-devel | |
- libtool | |
- perl-Test-Harness | |
tags: install_dependencies | |
- name: Download the CouchDB source files to /usr/local/couchdb | |
get_url: url=http://www.eu.apache.org/dist/couchdb/source/1.6.0/apache-couchdb-1.6.0.tar.gz dest=/usr/local/src | |
- name: Unarchive the CouchDB source files | |
command: chdir=/usr/local/src tar -xvzf apache-couchdb-1.6.0.tar.gz | |
- name: Configure and compile CouchDB from source | |
shell: cd /usr/local/src/apache-couchdb-1.6.0; make distclean; ./configure --with-erlang=/usr/lib64/erlang/usr/include; make && make install | |
- name: Add a couchdb user | |
user: name=couchdb createhome=no shell=/bin/bash system=yes | |
tags: add_user | |
- name: Change the ownership of the couchdb directories | |
file: name={{ item }} owner=couchdb group=couchdb mode=0770 | |
with_items: | |
- /usr/local/etc/couchdb | |
- /usr/local/var/lib/couchdb | |
- /usr/local/var/log/couchdb | |
- /usr/local/var/run/couchdb | |
tags: change_ownership | |
- name: Copy the couchdb script from /usr/local/etc/init.d/couchdb to /etc/init.t/couchdb | |
command: cp /usr/local/etc/rc.d/couchdb /etc/init.d/ | |
- name: Ensure that CouchDB is started and runs at boot time | |
service: name=couchdb state=running enabled=yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment