airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [16/29] airavata git commit: Added java role and make rabbitmq works with aws
Date Sat, 24 Sep 2016 01:58:41 GMT
Added java role and make rabbitmq works with aws


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/c18b06cb
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/c18b06cb
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/c18b06cb

Branch: refs/heads/develop
Commit: c18b06cb47333205f393e911b151560b74312922
Parents: ab13cf6
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Wed Aug 17 17:36:38 2016 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Wed Aug 17 17:36:38 2016 -0400

----------------------------------------------------------------------
 hosts                            |  3 ++-
 roles/common/tasks/main.yml      |  6 +++++
 roles/env_setup/tasks/main.yml   | 33 ++++--------------------
 roles/env_setup/vars/main.yml    | 15 -----------
 roles/java/tasks/main.yml        | 21 +++++++++++++++
 roles/java/vars/main.yml         | 15 +++++++++++
 roles/rabbitmq/handlers/main.yml |  3 +++
 roles/rabbitmq/tasks/main.yml    | 13 +++++++++-
 roles/wso2_is/tasks/main.yml     | 48 ++++++++---------------------------
 site.yml                         |  2 ++
 10 files changed, 76 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/hosts
----------------------------------------------------------------------
diff --git a/hosts b/hosts
index 819e1ab..b14e7fd 100644
--- a/hosts
+++ b/hosts
@@ -20,10 +20,11 @@
 [rabbitmq]
 #js-156.196.jetstream-cloud.org
 #js-171-11.jetstream-cloud.org rabbit_hostName="jetcloud-1-centos-7"
+54.236.73.114
 
 [database]
 #js-156.196.jetstream-cloud.org
 #js-171-11.jetstream-cloud.org
 
 [wso2is]
-107.23.143.252
+52.91.87.213

http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/roles/common/tasks/main.yml
----------------------------------------------------------------------
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index 18d628d..31bfaae 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -1,4 +1,10 @@
 ---
+- name: Install Airavata pre-requireties
+  yum: name={{ item }} state=latest update_cache=yes
+  with_items:
+    - git
+    - maven
+
 # Setup airavata source
 - name: Create deployment directory {{ deployment_dir }}
   file: path={{ deployment_dir }} state=directory mode=0755

http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/roles/env_setup/tasks/main.yml
----------------------------------------------------------------------
diff --git a/roles/env_setup/tasks/main.yml b/roles/env_setup/tasks/main.yml
index 395d0a8..a3ecb8c 100644
--- a/roles/env_setup/tasks/main.yml
+++ b/roles/env_setup/tasks/main.yml
@@ -3,38 +3,15 @@
 #All commons tasks goes here
 - name: Create a new user group "{{ group }}"
   group: name={{ group }}
+  become: yes
 
 - name: Create a new user "{{ user }}"
   user: name={{ user }} group={{ group }}
+  become: yes
 
-################################################################################
-- name: Install pre-requireties
-  yum: name={{ item }} state=latest update_cache=yes
-  with_items:
-    - git
-    - maven
-    - firewalld
-    - unzip  #need for wso2
-
-
-################################################################################
-# Install Orcal Java
-- name: download oracle java 8 rpm
-  get_url: url="{{ java_rpm_url }}" dest="{{ java_dir_source }}" headers='Cookie:oraclelicense=accept-securebackup-cookie'
-
-- name: Install oracle java 8
-  yum: name="{{ java_dir_source }}/{{ java_rpm_filename }}" state=present
-
-- name: set Oracle Java {{ java_version_string }} as default
-  alternatives:
-    name="{{ item.exe }}"
-    link="/usr/bin/{{ item.exe }}"
-    path="{{ item.path }}/{{ item.exe }}"
-  with_items:
-    - { path: "{{ java_home }}/jre/bin", exe: 'java' }
-    - { path: "{{ java_home }}/jre/bin", exe: 'keytool' }
-    - { path: "{{ java_home }}/bin", exe: 'javac' }
-    - { path: "{{ java_home }}/bin", exe: 'javadoc' }
+- name: Install Firewalld
+  yum: name=firewalld state=latest update_cache=yes
+  become: yes
 
   # TODO: stop iptables service, can't have both iptables and firewalld on same host
   # if we try to stop non existing service ansible fails.

http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/roles/env_setup/vars/main.yml
----------------------------------------------------------------------
diff --git a/roles/env_setup/vars/main.yml b/roles/env_setup/vars/main.yml
deleted file mode 100644
index a995684..0000000
--- a/roles/env_setup/vars/main.yml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-#Variables associated with this role
-# Oracle Java 8
-java_dir_source: "/usr/local/src"
-
-java_version: 8
-java_version_update: 91
-java_version_build: '14'
-java_version_string: "1.{{ java_version }}.0_{{ java_version_update }}"
-java_home: "/usr/java/jdk1.{{ java_version }}.0_{{ java_version_update }}"
-
-java_rpm_filename: "jdk-{{ java_version }}u{{ java_version_update }}-linux-x64.rpm"
-java_rpm_url: "http://download.oracle.com/otn-pub/java/jdk/{{ java_version }}u{{ java_version_update
}}-b{{ java_version_build }}/{{ java_rpm_filename }}"
-
-...

http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/roles/java/tasks/main.yml
----------------------------------------------------------------------
diff --git a/roles/java/tasks/main.yml b/roles/java/tasks/main.yml
new file mode 100644
index 0000000..92f2039
--- /dev/null
+++ b/roles/java/tasks/main.yml
@@ -0,0 +1,21 @@
+---
+# Install Orcal Java
+- name: download oracle java 8 rpm
+  get_url: url="{{ java_rpm_url }}" dest="{{ java_dir_source }}" headers='Cookie:oraclelicense=accept-securebackup-cookie'
+  become: yes
+
+- name: Install oracle java 8
+  yum: name="{{ java_dir_source }}/{{ java_rpm_filename }}" state=present
+  become: yes
+
+- name: set Oracle Java {{ java_version_string }} as default
+  alternatives:
+    name="{{ item.exe }}"
+    link="/usr/bin/{{ item.exe }}"
+    path="{{ item.path }}/{{ item.exe }}"
+  with_items:
+    - { path: "{{ java_home }}/jre/bin", exe: 'java' }
+    - { path: "{{ java_home }}/jre/bin", exe: 'keytool' }
+    - { path: "{{ java_home }}/bin", exe: 'javac' }
+    - { path: "{{ java_home }}/bin", exe: 'javadoc' }
+  become: yes

http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/roles/java/vars/main.yml
----------------------------------------------------------------------
diff --git a/roles/java/vars/main.yml b/roles/java/vars/main.yml
new file mode 100644
index 0000000..a995684
--- /dev/null
+++ b/roles/java/vars/main.yml
@@ -0,0 +1,15 @@
+---
+#Variables associated with this role
+# Oracle Java 8
+java_dir_source: "/usr/local/src"
+
+java_version: 8
+java_version_update: 91
+java_version_build: '14'
+java_version_string: "1.{{ java_version }}.0_{{ java_version_update }}"
+java_home: "/usr/java/jdk1.{{ java_version }}.0_{{ java_version_update }}"
+
+java_rpm_filename: "jdk-{{ java_version }}u{{ java_version_update }}-linux-x64.rpm"
+java_rpm_url: "http://download.oracle.com/otn-pub/java/jdk/{{ java_version }}u{{ java_version_update
}}-b{{ java_version_build }}/{{ java_rpm_filename }}"
+
+...

http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/roles/rabbitmq/handlers/main.yml
----------------------------------------------------------------------
diff --git a/roles/rabbitmq/handlers/main.yml b/roles/rabbitmq/handlers/main.yml
index 4515589..5ce5a59 100644
--- a/roles/rabbitmq/handlers/main.yml
+++ b/roles/rabbitmq/handlers/main.yml
@@ -2,9 +2,12 @@
 # Rabbitmq related handlers
 - name: start rabbitmq
   service: name=rabbitmq-server state=started
+  become: yes
 
 - name: stop rabbitmq
   service: name=rabbitmq-server state=stopped
+  become: yes
 
 - name: restart rabbitmq
   service: name=rabbitmq-server state=restarted
+  become: yes

http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/roles/rabbitmq/tasks/main.yml
----------------------------------------------------------------------
diff --git a/roles/rabbitmq/tasks/main.yml b/roles/rabbitmq/tasks/main.yml
index d1e7ce5..b487737 100644
--- a/roles/rabbitmq/tasks/main.yml
+++ b/roles/rabbitmq/tasks/main.yml
@@ -23,27 +23,38 @@
   become: yes
 
 - name: Edit /etc/hosts file
-  lineinfile: dest=/etc/hosts line="{{ _ip4.stdout }} {{ rabbit_hostName }}"
+  lineinfile: dest=/etc/hosts line="{{ _ip4.stdout }} {{ ansible_fqdn }}"
   notify:
     - restart rabbitmq
   become: yes
 
 - name: Start Rabbitmq server
   service: name=rabbitmq-server state=started
+  become: yes
 
 - name: Enable rabbitmq management plugin
   rabbitmq_plugin: names=rabbitmq_management state=enabled
+  notify:
+    - restart rabbitmq
+  become: yes
 
 - name: Create rabbitmq vhost {{ rabbitmq_vhost }}
   rabbitmq_vhost: name="{{ rabbitmq_vhost }}" state=present
+  become: yes
 
 - name: Add user {{ rabbitmq_user }} to vhost {{ rabbitmq_vhost }}  and give permission
   rabbitmq_user: user="{{ rabbitmq_user }}"
                  password="{{ rabbitmq_password }}"
                  vhost="{{ rabbitmq_vhost }}"
+                 tags="administrator"
                  configure_priv=.*
                  read_priv=.*
                  write_priv=.*
                  state=present
+  become: yes
+
+- name: restart rabbitmq
+  service: name=rabbitmq-server state=restarted
+  become: yes
 
 ...

http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/roles/wso2_is/tasks/main.yml
----------------------------------------------------------------------
diff --git a/roles/wso2_is/tasks/main.yml b/roles/wso2_is/tasks/main.yml
index 6cd03b0..1e506c2 100644
--- a/roles/wso2_is/tasks/main.yml
+++ b/roles/wso2_is/tasks/main.yml
@@ -1,42 +1,15 @@
 ---
-# TODO- replace java install with env_setup role
-# Install Orcal Java
-- name: download oracle java 8 rpm
-  get_url: url="{{ java_rpm_url }}" dest="{{ java_dir_source }}" headers='Cookie:oraclelicense=accept-securebackup-cookie'
-  become: yes
-  become_user: root
-
-- name: Install oracle java 8
-  yum: name="{{ java_dir_source }}/{{ java_rpm_filename }}" state=present
-  become: yes
-  become_user: root
-
-- name: set Oracle Java {{ java_version_string }} as default
-  alternatives:
-    name="{{ item.exe }}"
-    link="/usr/bin/{{ item.exe }}"
-    path="{{ item.path }}/{{ item.exe }}"
-  with_items:
-    - { path: "{{ java_home }}/jre/bin", exe: 'java' }
-    - { path: "{{ java_home }}/jre/bin", exe: 'keytool' }
-    - { path: "{{ java_home }}/bin", exe: 'javac' }
-    - { path: "{{ java_home }}/bin", exe: 'javadoc' }
-  become: yes
-  become_user: root
-
-- name: Install pre-requireties
+- name: install role pre-requireties
   yum: name=unzip state=latest update_cache=yes
   become: yes
 
-- name: Install pre-requireties
-  yum: name=firewalld state=latest update_cache=yes
-  become: yes
 # downlaod wso2 is
 # extract it
 # - name: Download and unarchive wso2 is
 #   unarchive: src="{{ zookeeper_url }}" dest="{{ user_home }}" copy=no owner="{{ user }}"
group="{{ group }}"
 # for now wso2is from localhost
-- name: Copy WSO2 IS
+
+- name: copy WSO2 IS
   unarchive: >
     src="{{ wso2_is_dist }}"
     dest="{{ user_home }}/"
@@ -44,13 +17,13 @@
     group="{{ group }}"
     creates="{{ user_home }}/{{ wso2_is_dir }}/bin/wso2server.sh"
 
-- name: Copy carbon.xml
-  template: src=carbon.xml.j2 dest="{{ user_home }}/{{ wso2_is_dir }}/repository/conf/carbon.xml"
owner="{{ user }}" group="{{ group }}" mode="u=rw,g=r,o=r"
-
-
-- name: Start firewalld service
-  service: name=firewalld state=started
-  become: yes
+- name: copy carbon.xml
+  template: >
+    src=carbon.xml.j2
+    dest="{{ user_home }}/{{ wso2_is_dir }}/repository/conf/carbon.xml"
+    owner="{{ user }}"
+    group="{{ group }}"
+    mode="u=rw,g=r,o=r"
 
 - name: open carabon management console port
   firewalld: port=9443/tcp zone=public permanent=true state=enabled immediate=yes
@@ -65,5 +38,4 @@
 # - name: stop wso2 is
   # command: ./bin/airavata-server-stop.sh -f chdir="{{ gfac_dir }}/{{ airavata_dist }}/"
removes="{{ gfac_dir }}/{{ airavata_dist }}/bin/server_start_*"
 
-
 ...

http://git-wip-us.apache.org/repos/asf/airavata/blob/c18b06cb/site.yml
----------------------------------------------------------------------
diff --git a/site.yml b/site.yml
index 0de15ef..bae8573 100644
--- a/site.yml
+++ b/site.yml
@@ -39,5 +39,7 @@
 - hosts: wso2is
   tags: wso2is
   roles:
+    - env_setup
+    - java
     - wso2_is
 ...


Mime
View raw message