various fixes to make it work
This commit is contained in:
parent
f0269f1b49
commit
394b5341b4
|
@ -12,7 +12,7 @@ MAINCLASS="com.ubnt.ace.Launcher"
|
||||||
PIDFILE="/var/run/${NAME}/${NAME}.pid"
|
PIDFILE="/var/run/${NAME}/${NAME}.pid"
|
||||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||||
|
|
||||||
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
|
JAVA_HOME="{{ java_home }}"
|
||||||
# JSVC - for running java apps as services
|
# JSVC - for running java apps as services
|
||||||
JSVC=`which jsvc`
|
JSVC=`which jsvc`
|
||||||
#JSVC_OPTS="-debug"
|
#JSVC_OPTS="-debug"
|
||||||
|
@ -20,7 +20,6 @@ JSVC_OPTS="${JSVC_OPTS}\
|
||||||
-home ${JAVA_HOME} \
|
-home ${JAVA_HOME} \
|
||||||
-cp /usr/share/java/commons-daemon.jar:${BASEDIR}/lib/ace.jar \
|
-cp /usr/share/java/commons-daemon.jar:${BASEDIR}/lib/ace.jar \
|
||||||
-pidfile ${PIDFILE} \
|
-pidfile ${PIDFILE} \
|
||||||
-procname ${NAME} \
|
|
||||||
-outfile SYSLOG \
|
-outfile SYSLOG \
|
||||||
-errfile SYSLOG \
|
-errfile SYSLOG \
|
||||||
-Djava.awt.headless=true -Xmx1024M"
|
-Djava.awt.headless=true -Xmx1024M"
|
||||||
|
|
17
unifi.play
17
unifi.play
|
@ -2,16 +2,17 @@
|
||||||
|
|
||||||
- hosts: unifi_controllers
|
- hosts: unifi_controllers
|
||||||
vars:
|
vars:
|
||||||
- unifi_zip_file: UniFi.zip
|
- unifi_zip_file: UniFi-2.4.6.zip
|
||||||
- unifi_zip_dest: /usr/local/src/UniFi.zip
|
- unifi_zip_dest: /usr/local/src/UniFi-2.4.6.zip
|
||||||
- unifi_prefix: /opt
|
- unifi_prefix: /opt
|
||||||
- unifi_uid: unifi
|
- unifi_uid: unifi
|
||||||
- unifi_gid: unifi
|
- unifi_gid: unifi
|
||||||
- ntp_server: pool.ntp.org
|
- ntp_server: pool.ntp.org
|
||||||
|
- java_home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64
|
||||||
sudo: yes
|
sudo: yes
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: check os is ok
|
- name: abort if os is not suitable
|
||||||
when: ansible_os_family != "RedHat"
|
when: ansible_os_family != "RedHat"
|
||||||
fail: "msg={{ansible_os_family}} is not supported by this playbook"
|
fail: "msg={{ansible_os_family}} is not supported by this playbook"
|
||||||
|
|
||||||
|
@ -19,12 +20,12 @@
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family == "RedHat"
|
||||||
yum: name={{ item }} state=present
|
yum: name={{ item }} state=present
|
||||||
with_items:
|
with_items:
|
||||||
- java-1.7.0-openjdk
|
- java-1.6.0-openjdk
|
||||||
- jakarta-commons-daemon-jsvc
|
- jakarta-commons-daemon-jsvc
|
||||||
- mongodb-server
|
- mongodb-server
|
||||||
|
|
||||||
- name: ensure mongod is running
|
- name: no need for the standard mongod service
|
||||||
service: name=mongod enabled=yes state=started
|
service: name=mongod enabled=no state=stopped
|
||||||
|
|
||||||
- name: setup unifi group
|
- name: setup unifi group
|
||||||
group: name={{ unifi_gid }} system=yes state=present
|
group: name={{ unifi_gid }} system=yes state=present
|
||||||
|
@ -36,7 +37,7 @@
|
||||||
copy: src={{ unifi_zip_file }} dest={{ unifi_zip_dest }}
|
copy: src={{ unifi_zip_file }} dest={{ unifi_zip_dest }}
|
||||||
|
|
||||||
- name: extract unifi
|
- name: extract unifi
|
||||||
command: /usr/bin/unzip -f -o {{ unifi_zip_dest }} -d {{ unifi_prefix }}
|
command: /usr/bin/unzip -o {{ unifi_zip_dest }} -d {{ unifi_prefix }} creates=/opt/UniFi
|
||||||
|
|
||||||
- name: fix permissions
|
- name: fix permissions
|
||||||
command: /bin/chown -R {{ unifi_uid }}:{{ unifi_gid }} {{ unifi_prefix }}/UniFi
|
command: /bin/chown -R {{ unifi_uid }}:{{ unifi_gid }} {{ unifi_prefix }}/UniFi
|
||||||
|
@ -48,7 +49,7 @@
|
||||||
template: src=config.properties dest={{ unifi_prefix }}/UniFi/data/config.properties owner={{ unifi_uid }} group={{ unifi_gid }}
|
template: src=config.properties dest={{ unifi_prefix }}/UniFi/data/config.properties owner={{ unifi_uid }} group={{ unifi_gid }}
|
||||||
|
|
||||||
- name: install init script
|
- name: install init script
|
||||||
copy: src=unifi.init dest=/etc/init.d/unifi owner=root group=root mode=755
|
template: src=unifi.init dest=/etc/init.d/unifi owner=root group=root mode=755
|
||||||
|
|
||||||
- name: start unifi service
|
- name: start unifi service
|
||||||
service: name=unifi enabled=yes state=started
|
service: name=unifi enabled=yes state=started
|
||||||
|
|
Loading…
Reference in New Issue
Block a user