# Apache
-- service: name=apache2 state=stopped
-- copy:
+- name: Stop apache2
+ service: name=apache2 state=stopped
+- name: Setup eg.conf
+ copy:
src: "{{repo_base}}/Evergreen/Open-ILS/examples/apache_24/eg_24.conf"
dest: /etc/apache2/sites-available/eg.conf
-- copy:
+- name: Setup eg_vhost.conf
+ copy:
src: "{{repo_base}}/Evergreen/Open-ILS/examples/apache_24/eg_vhost_24.conf"
dest: /etc/apache2/eg_vhost.conf
-- copy:
+- name: Setup eg_startup
+ copy:
src: "{{repo_base}}/Evergreen/Open-ILS/examples/apache/eg_startup"
dest: /etc/apache2/
-- file: path=/etc/apache2/ssl state=directory
+- name: Create SSL Certs directory
+ file: path=/etc/apache2/ssl state=directory
- name: Setup SSL Certs
shell: >
cd /etc/apache2/ssl
&& openssl req -new -x509 -days 365 -nodes -out server.crt
-keyout server.key -subj "/C=XX/ST=XX/L=XX/O=XX/OU=XX/CN={{domain_name}}"
-- shell: /usr/sbin/a2dismod mpm_event
-- shell: /usr/sbin/a2enmod mpm_prefork
-- shell: /usr/sbin/a2enmod deflate
-- shell: /usr/sbin/a2enmod headers
-- shell: /usr/sbin/a2enmod expires
-- shell: /usr/sbin/a2enmod rewrite
-- shell: /usr/sbin/a2dissite 000-default
-- shell: /usr/sbin/a2ensite eg.conf
-- file: path=/var/lock/apache2 owner=opensrf group=opensrf
-- replace:
+- name: Disable mpm_event
+ shell: /usr/sbin/a2dismod mpm_event
+- name: Enable mpm_prefork
+ shell: /usr/sbin/a2enmod mpm_prefork
+- name: Enable apache mod deflate
+ shell: /usr/sbin/a2enmod deflate
+- name: Enable apache mod headers
+ shell: /usr/sbin/a2enmod headers
+- name: Enable apache mod expires
+ shell: /usr/sbin/a2enmod expires
+- name: Enable apache mod rewrite
+ shell: /usr/sbin/a2enmod rewrite
+- name: Disable default site for apache
+ shell: /usr/sbin/a2dissite 000-default
+- name: Enable eg.conf site for apache
+ shell: /usr/sbin/a2ensite eg.conf
+- name: Change ownership of /var/lock/apache2 to opensrf
+ file: path=/var/lock/apache2 owner=opensrf group=opensrf
+- name: Change run-user for apache to opensrf
+ replace:
dest: /etc/apache2/envvars
regexp: 'www-data'
replace: 'opensrf'
-- replace:
+- name: Set KeepAliveTimeout value
+ replace:
dest: /etc/apache2/apache2.conf
regexp: 'KeepAliveTimeout .*'
replace: 'KeepAliveTimeout 1'
cd {{repo_base}}/Evergreen
&& PERL_MM_USE_DEFAULT=1 make -f
Open-ILS/src/extras/Makefile.install {{os_build_target}}
-- file: dest="{{repo_base}}" owner=opensrf group=opensrf recurse=yes
+- name: Set ownership of {{repo_base}} to opensrf
+ file: dest="{{repo_base}}" owner=opensrf group=opensrf recurse=yes
- name: Build Evergreen
become: true
become_user: opensrf
&& autoreconf -i
&& ./configure --prefix={{eg_install_path}} --sysconfdir={{eg_install_path}}/conf
&& make
-- file: dest="{{eg_install_path}}" owner=opensrf group=opensrf recurse=yes
+- name: Set ownership of {{eg_install_path}} to opensrf
+ file: dest="{{eg_install_path}}" owner=opensrf group=opensrf recurse=yes
state: link
src: "{{eg_install_path}}/var/web/xul/current/server"
dest: "{{eg_install_path}}/var/web/xul/server"
-- copy:
+- name: Setup opensrf.xml config file
+ copy:
src: "{{eg_install_path}}/conf/opensrf.xml.example"
dest: "{{eg_install_path}}/conf/opensrf.xml"
force: no
-- copy:
+- name: Setup opensrf_core.xml config file
+ copy:
src: "{{eg_install_path}}/conf/opensrf_core.xml.example"
dest: "{{eg_install_path}}/conf/opensrf_core.xml"
force: no
-- get_url: url={{dojo_url}} dest=/tmp/dojo-release-{{dojo_version}}.tar.gz
-- unarchive:
+- name: Get URL for dojo
+ get_url: url={{dojo_url}} dest=/tmp/dojo-release-{{dojo_version}}.tar.gz
+- name: Unarchive dojo tarball
+ unarchive:
src: /tmp/dojo-release-{{dojo_version}}.tar.gz
dest: /tmp/
-- copy: src=/tmp/dojo-release-{{dojo_version}}/ dest={{eg_install_path}}/var/web/js/dojo/
-- file: dest={{eg_install_path}} owner=opensrf group=opensrf recurse=yes
-- copy: src={{eg_install_path}}/conf/srfsh.xml.example dest=/home/opensrf/.srfsh.xml force=no
-- file: dest=/home/opensrf/.srfsh.xml owner=opensrf group=opensrf
+- name: Copy dojo source files into place
+ copy: src=/tmp/dojo-release-{{dojo_version}}/ dest={{eg_install_path}}/var/web/js/dojo/
+- name: Set ownership of {{eg_install_path}} to opensrf
+ file: dest={{eg_install_path}} owner=opensrf group=opensrf recurse=yes
+- name: Setup .srfsh.xml for opensrf user
+ copy: src={{eg_install_path}}/conf/srfsh.xml.example dest=/home/opensrf/.srfsh.xml force=no
+- name: Set ownership of .srfsh.xml to opensrf
+ file: dest=/home/opensrf/.srfsh.xml owner=opensrf group=opensrf
- name: Copy ldconfig
copy:
src: "{{playbook_dir}}/evergreen/evergreen.ld.conf"
dest: /etc/ld.so.conf.d/evergreen.ld.conf
-- shell: ldconfig
+- name: Run ldconfig
+ shell: ldconfig
cd {{repo_base}}/Evergreen
&& PERL_MM_USE_DEFAULT=1 make -f
Open-ILS/src/extras/Makefile.install {{os_build_target}}-developer
-- file: dest="{{repo_base}}" owner=opensrf group=opensrf recurse=yes
+- name: Set ownership of {{repo_base}} to opensrf
+ file: dest="{{repo_base}}" owner=opensrf group=opensrf recurse=yes
- name: Install Grunt
npm: name=grunt-cli global=true
- name: Node Build
# Apache must be reconfigured before NGINX is installed
# or the NGINX install will fail on conflicting ports
-- replace:
+- name: Change Apache ports.conf to listen 7080
+ replace:
dest: /etc/apache2/ports.conf
regexp: 'Listen 80'
replace: 'Listen 7080'
-- replace:
+- name: Change Apache ports.conf to listen 7443
+ replace:
dest: /etc/apache2/ports.conf
regexp: 'Listen 443'
replace: 'Listen 7443'
-- replace:
+- name: Change Evergreen eg.conf to listen 7080
+ replace:
dest: /etc/apache2/sites-available/eg.conf
regexp: ':80'
replace: ':7080'
-- replace:
+- name: Change Evergreen eg.conf to listen 7443
+ replace:
dest: /etc/apache2/sites-available/eg.conf
regexp: ':443'
replace: ':7443'
dest: "{{eg_install_path}}/conf/opensrf_core.xml"
regexp: '<logfile>\/(.*)\n.*<!--'
replace: '<!--<logfile>/\1-->'
-- replace:
+- name: Update opensrf_core.xml for rsyslog
+ replace:
dest: "{{eg_install_path}}/conf/opensrf_core.xml"
regexp: '-->.*\n(.*)<loglevel>'
replace: '<loglevel>'
-- replace:
+- name: Update opensrf_core.xml for rsyslog
+ replace:
dest: "{{eg_install_path}}/conf/opensrf_core.xml"
regexp: '-->.*\n(.*)</gateway>'
replace: '</gateway>'
mode: 0600
- name: Restarting Ejabberd
service: name=ejabberd state=restarted
-- pause: seconds=5
-- shell: ejabberdctl unregister router private.localhost
-- shell: ejabberdctl unregister opensrf private.localhost
-- shell: ejabberdctl unregister router public.localhost
-- shell: ejabberdctl unregister opensrf public.localhost
-- shell: ejabberdctl register router private.localhost {{ejabberd_password}}
-- shell: ejabberdctl register opensrf private.localhost {{ejabberd_password}}
-- shell: ejabberdctl register router public.localhost {{ejabberd_password}}
-- shell: ejabberdctl register opensrf public.localhost {{ejabberd_password}}
+- name: Wait a moment for Ejabberd
+ pause: seconds=5
+- name: Unregister Ejabberd user router@private.localhost
+ shell: ejabberdctl unregister router private.localhost
+- name: Unregister Ejabberd user opensrf@private.localhost
+ shell: ejabberdctl unregister opensrf private.localhost
+- name: Unregister Ejabberd user router@public.localhost
+ shell: ejabberdctl unregister router public.localhost
+- name: Unregister Ejabberd user opensrf@public.localhost
+ shell: ejabberdctl unregister opensrf public.localhost
+- name: Register Ejabberd user router@private.localhost
+ shell: ejabberdctl register router private.localhost {{ejabberd_password}}
+- name: Register Ejabberd user opensrf@private.localhost
+ shell: ejabberdctl register opensrf private.localhost {{ejabberd_password}}
+- name: Register Ejabberd user router@public.localhost
+ shell: ejabberdctl register router public.localhost {{ejabberd_password}}
+- name: Register Ejabberd user opensrf@public.localhost
+ shell: ejabberdctl register opensrf public.localhost {{ejabberd_password}}
cd {{repo_base}}/OpenSRF
&& PERL_MM_USE_DEFAULT=1 make -f
src/extras/Makefile.install {{os_build_target}}
-- file: dest="{{repo_base}}" owner=opensrf group=opensrf recurse=yes
+- name: Set ownership of {{repo_base}} to opensrf
+ file: dest="{{repo_base}}" owner=opensrf group=opensrf recurse=yes
- name: Build OpenSRF
become: true
become_user: opensrf
environment:
PATH: "{{ansible_env.PATH}}:{{eg_install_path}}/bin"
shell: cd {{repo_base}}/OpenSRF && make install
-- file: dest="{{eg_install_path}}" owner=opensrf group=opensrf recurse=yes
+- name: Set ownership of {{eg_install_path}} to opensrf
+ file: dest="{{eg_install_path}}" owner=opensrf group=opensrf recurse=yes
shell: /bin/bash
# Environment changes added to ~/.bash_profile to ensure they are
# loaded regardless of whether opensrf is used interactively.
-- lineinfile:
+- name: Check export PATH for opensrf user profile
+ lineinfile:
dest: /home/opensrf/.bash_profile
create: yes
owner: opensrf
mode: 0644
regexp: '^export PATH='
line: 'export PATH="{{eg_install_path}}/bin:$PATH"'
-- lineinfile:
+- name: Check LD_LIBRARY_PATH for opensrf user profile
+ lineinfile:
dest: /home/opensrf/.bash_profile
regexp: '^export LD_LIBRARY_PATH='
line: 'export LD_LIBRARY_PATH="{{eg_install_path}}/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH"'
-- lineinfile:
+- name: Check /etc/hosts file for public.{{domain_name}}
+ lineinfile:
dest: /etc/hosts
regexp: '^127.0.1.2'
line: '127.0.1.2 public.{{domain_name}}'
-- lineinfile:
+- name: Check /etc/hosts file for private.{{domain_name}}
+ lineinfile:
dest: /etc/hosts
regexp: '^127.0.1.3'
line: '127.0.1.3 private.{{domain_name}}'
dest: "/tmp/apache-websocket"
- name: Install Websockets
shell: cd /tmp/apache-websocket && apxs2 -i -a -c mod_websocket.c
-- stat: path=/etc/apache2-websockets
+- name: register variable websocketsconf
+ stat: path=/etc/apache2-websockets
register: websocketsconf
- block:
- name: Create Websockets Instance
shell: >
sh /usr/share/doc/apache2/examples/setup-instance websockets
&& a2dismod websocket
- - lineinfile:
+ - name: Confirm websockets run user is opensrf
+ lineinfile:
state: present
dest: /etc/apache2-websockets/envvars
regexp: 'APACHE_RUN_USER'