Commit eaac40e2 by arbabnazar

change the tanaguru_prerequisites to tanguru_debian_pkgs

parent d5ae98c1
---
tanaguru_prerequisites:
tanguru_debian_pkgs:
- openjdk-7-jre
- unzip
- libmysql-java
......
---
- name: Add the Partner repository
apt_repository:
repo: "{{ item }}"
state: present
with_items:
- "deb http://archive.canonical.com/ubuntu {{ ansible_distribution_release }} partner"
- "deb-src http://archive.canonical.com/ubuntu {{ ansible_distribution_release }} partner"
- name: Set the Locale
locale_gen:
name: "{{ locale_setting }}"
state: present
- name: Set Postfix options
debconf:
name: postifx
question: "{{ item.question }}"
value: "{{ item.value }} "
vtype: "string"
with_items:
- { question: "postfix/mailname", value: " " }
- { question: "postfix/main_mailer_type", value: "Satellite system" }
- name: Install the TanaGuru Prerequisites
apt:
name: "{{ item }}"
update_cache: yes
state: installed
with_items: tanaguru_prerequisites
- name: Modify the my.cnf file for max_allowed_packet option
lineinfile:
dest: /etc/mysql/my.cnf
regexp: '^max_allowed_packet'
line: 'max_allowed_packet = 64M'
state: present
notify:
- restart mysql
- name: Create a soft link for tomcat jar and mysql connector
file:
dest: "{{ item.dest }}"
src: "{{ item.src }}"
state: link
with_items:
- { src: '/usr/share/java/spring3-instrument-tomcat.jar', dest: '/usr/share/tomcat6/lib/spring3-instrument-tomcat.jar' }
- { src: '/usr/share/java/mysql-connector-java.jar', dest: '/usr/share/tomcat6/lib/mysql-connector-java.jar'}
- name: Copy the xvfb template to /etc/init.d
template:
dest: /etc/init.d/xvfb
src: xvfb.j2
owner: root
group: root
mode: 755
register: xvfb
notify:
- restart xvfb
- name: Configure xvfb to run at startup
command: update-rc.d xvfb defaults
ignore_errors: yes
when: xvfb.changed
- name: Download the latest ESR Firfox
get_url:
url: "{{ fixfox_esr_link }}"
dest: "/tmp/{{ fixfox_esr_link | basename }}"
- name: Unzip the downloaded Firfox zipped file
unarchive:
src: "/tmp/{{ fixfox_esr_link | basename }}"
dest: /opt
copy: no
- name: Download the latest TanaGuru tarball
get_url:
url: "{{ tanaguru_download_link }}"
dest: "/tmp/{{ tanaguru_download_link | basename }}"
- name: Unzip the downloaded Firfox zipped file
unarchive:
src: "/tmp/{{ tanaguru_download_link | basename }}"
dest: "~/"
copy: no
- name: Create MySQL database for TanaGuru
mysql_db:
name: "{{ item.tanaguru_database }}"
state: present
encoding: utf8
collation: utf8_general_ci
with_items: tanaguru_parameters
- name: Create MySQL user for TanaGuru
mysql_user:
name: "{{ item.tanaguru_db_user }}"
password: "{{ item.tanaguru_db_password }}"
host: localhost
priv: "{{ item.tanaguru_database }}.*:ALL"
state: present
with_items: tanaguru_parameters
- name: Check that tanaguru app is running
shell: >
/bin/ps aux | grep -i tanaguru
register: tanaguru_app
changed_when: no
- name: Install the TanaGuru
shell: >
/bin/echo "yes" | ./install.sh --mysql-tg-user "{{ item.tanaguru_db_user }}" \
--mysql-tg-passwd "{{ item.tanaguru_db_password }}" \
--mysql-tg-db "{{ item.tanaguru_database }}" \
--tanaguru-url "{{ item.tanaguru_url }}" \
--tomcat-webapps /var/lib/tomcat6/webapps \
--tomcat-user tomcat6 \
--tg-admin-email "{{ item.tanaguru_admin_email }}" \
--tg-admin-passwd "{{ item.tg_admin_passwd }}" \
--firefox-esr-path /opt/firefox/firefox \
--display-port ":99.1"
args:
chdir: "~/{{ tanaguru_download_link | basename | regex_replace('.tar.gz$', '') }}"
with_items: tanaguru_parameters
when: "tanaguru_app.stdout.find('/etc/tanaguru/') == -1"
notify:
- restart tomcat6
\ No newline at end of file
---
- include: deploy.yml
- name: Add the Partner repository
apt_repository:
repo: "{{ item }}"
state: present
with_items:
- "deb http://archive.canonical.com/ubuntu {{ ansible_distribution_release }} partner"
- "deb-src http://archive.canonical.com/ubuntu {{ ansible_distribution_release }} partner"
- name: Set the Locale
locale_gen:
name: "{{ locale_setting }}"
state: present
- name: Set Postfix options
debconf:
name: postifx
question: "{{ item.question }}"
value: "{{ item.value }} "
vtype: "string"
with_items:
- { question: "postfix/mailname", value: " " }
- { question: "postfix/main_mailer_type", value: "Satellite system" }
- name: Install the TanaGuru Prerequisites
apt:
name: "{{ item }}"
update_cache: yes
state: installed
with_items: tanguru_debian_pkgs
- name: Modify the my.cnf file for max_allowed_packet option
lineinfile:
dest: /etc/mysql/my.cnf
regexp: '^max_allowed_packet'
line: 'max_allowed_packet = 64M'
state: present
notify:
- restart mysql
- name: Create a soft link for tomcat jar and mysql connector
file:
dest: "{{ item.dest }}"
src: "{{ item.src }}"
state: link
with_items:
- { src: '/usr/share/java/spring3-instrument-tomcat.jar', dest: '/usr/share/tomcat6/lib/spring3-instrument-tomcat.jar' }
- { src: '/usr/share/java/mysql-connector-java.jar', dest: '/usr/share/tomcat6/lib/mysql-connector-java.jar'}
- name: Copy the xvfb template to /etc/init.d
template:
dest: /etc/init.d/xvfb
src: xvfb.j2
owner: root
group: root
mode: 755
register: xvfb
notify:
- restart xvfb
- name: Configure xvfb to run at startup
command: update-rc.d xvfb defaults
ignore_errors: yes
when: xvfb.changed
- name: Download the latest ESR Firfox
get_url:
url: "{{ fixfox_esr_link }}"
dest: "/tmp/{{ fixfox_esr_link | basename }}"
- name: Unzip the downloaded Firfox zipped file
unarchive:
src: "/tmp/{{ fixfox_esr_link | basename }}"
dest: /opt
copy: no
- name: Download the latest TanaGuru tarball
get_url:
url: "{{ tanaguru_download_link }}"
dest: "/tmp/{{ tanaguru_download_link | basename }}"
- name: Unzip the downloaded Firfox zipped file
unarchive:
src: "/tmp/{{ tanaguru_download_link | basename }}"
dest: "~/"
copy: no
- name: Create MySQL database for TanaGuru
mysql_db:
name: "{{ item.tanaguru_database }}"
state: present
encoding: utf8
collation: utf8_general_ci
with_items: tanaguru_parameters
- name: Create MySQL user for TanaGuru
mysql_user:
name: "{{ item.tanaguru_db_user }}"
password: "{{ item.tanaguru_db_password }}"
host: localhost
priv: "{{ item.tanaguru_database }}.*:ALL"
state: present
with_items: tanaguru_parameters
- name: Check that tanaguru app is running
shell: >
/bin/ps aux | grep -i tanaguru
register: tanaguru_app
changed_when: no
- name: Install the TanaGuru
shell: >
/bin/echo "yes" | ./install.sh --mysql-tg-user "{{ item.tanaguru_db_user }}" \
--mysql-tg-passwd "{{ item.tanaguru_db_password }}" \
--mysql-tg-db "{{ item.tanaguru_database }}" \
--tanaguru-url "{{ item.tanaguru_url }}" \
--tomcat-webapps /var/lib/tomcat6/webapps \
--tomcat-user tomcat6 \
--tg-admin-email "{{ item.tanaguru_admin_email }}" \
--tg-admin-passwd "{{ item.tg_admin_passwd }}" \
--firefox-esr-path /opt/firefox/firefox \
--display-port ":99.1"
args:
chdir: "~/{{ tanaguru_download_link | basename | regex_replace('.tar.gz$', '') }}"
with_items: tanaguru_parameters
when: "tanaguru_app.stdout.find('/etc/tanaguru/') == -1"
notify:
- restart tomcat6
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment