Commit 7de5de1
2013-10-19 15:36:51
Changed files (3)
ims-ansible
ims-ansible/ims-playbook.yml
@@ -0,0 +1,88 @@
+---
+- hosts: local
+ vars:
+ jdk_url: "http://download.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-x64.tar.gz"
+ jdk_file: "jdk-7u40-linux-x64.tar.gz"
+ jdk_extract_dir: "jdk1.7.0_40"
+ jdk_header: "Cookie:gpw_e24=http%3A%2F%2Fwww.oracle.com"
+ jdk_install_dir: "/usr/lib/jvm"
+ jdk_priority: 9001 # over 9000 :P
+
+ ser_dir: "/opt/OpenIMSCore/ser_ims"
+ ser_repo: "http://svn.berlios.de/svnroot/repos/openimscore/ser_ims/trunk"
+ fhoss_dir: "/opt/OpenIMSCore/FHoSS"
+ fhoss_repo: "http://svn.berlios.de/svnroot/repos/openimscore/FHoSS/trunk"
+
+ tasks:
+ - name: ensure ims dependencies are installed
+ apt: pkg={{ item }} state=latest update_cache=yes cache_valid_time=3600
+ sudo: yes
+ with_items:
+ - vim
+ - bison
+ - libcurl4-gnutls-dev
+ - libxml2-dev
+ - byobu # huh?
+ - debhelper
+ - cdbs
+ - lintian
+ - build-essential
+ - fakeroot
+ - devscripts
+ - ipsec-tools
+ - pbuilder
+ - dh-make
+ - debootstrap
+ - dpatch
+ - flex
+ - libmysqlclient-dev
+ - ant
+ - docbook-to-man
+ - bind9
+ - tmux
+ - subversion
+ - htop
+
+ - name: get the oracle jdk from their lame server
+ command: wget --quiet --no-cookies --header {{ jdk_header }} {{ jdk_url }} creates={{ jdk_file }}
+ - name: extract jdk
+ command: tar -zxf {{ jdk_file }} creates={{ jdk_extract_dir }}
+ - name: install (move) jdk to jvm dir
+ command: mv {{ jdk_extract_dir }} {{ jdk_install_dir }} creates={{ jdk_install_dir }}/{{jdk_extract_dir}}
+ sudo: yes
+ - name: set default java
+ command: update-alternatives --install {{ item.java_bin }} {{ item.java_bin_name }} {{ jdk_install_dir }}/{{ jdk_extract_dir }}/bin/{{ item.java_bin_name }} {{ jdk_priority }}
+ sudo: yes
+ with_items:
+ - { java_bin: "/usr/bin/java", java_bin_name: "java" }
+ - { java_bin: "/usr/bin/javac", java_bin_name: "javac" }
+ - { java_bin: "/usr/bin/javaws", java_bin_name: "javaws" }
+
+ - name: create IMS directories
+ file: path={{ item }} state=directory
+ sudo: yes
+ with_items:
+ - /opt
+ - /opt/OpenIMSCore
+
+ - name: checkout SER code
+ subversion: repo={{ ser_repo }} dest={{ ser_dir }}
+ sudo: yes
+ - name: checkout HSS mgmt code
+ subversion: repo={{ fhoss_repo }} dest={{ fhoss_dir }}
+ sudo: yes
+
+ - name: make SER
+ command: make install-libs all chdir={{ ser_dir }}
+ sudo: yes
+
+ - name: make FHoSS
+ command: ant {{ item }} chdir={{ fhoss_dir }}
+ sudo: yes
+ with_items:
+ - compile
+ - deploy
+
+ - name: fix FHoSS directory permissions
+ file: path={{ fhoss_dir }}/deploy state=directory recurse=yes mode=0777
+ sudo: yes
ims-ansible/inventory
@@ -0,0 +1,2 @@
+[local]
+localhost ansible_connection=local
ims-ansible/setup
@@ -0,0 +1,16 @@
+# Building an ansible playbook to replace the IMS-install.sh bash script
+
+# setup ansible and get working
+sudo apt-get update
+sudo apt-get install git python-yaml python-jinja2 vim # ansible dep
+git clone https://github.com/ansible/ansible
+source ansible/hacking/env-setup
+
+# test local run of ansible
+# create inventory file (inventory)
+ansible local -i inventory -m setup # run test connection, returns all facts about target
+# if this is failing, the first thing to make sure is the user you are running
+# has a passwordless sudo ability
+
+# build playbook (ims-playbook.yml)
+