Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
i18n install_evergreen.yml
---
#ansible-playbook /mnt/evergreen/playbooks/restart_app_services.yml --private-key /home/user/.ssh/id_rsa -vvvv -e "hosts=192.168.12.49"
- hosts: '{{hosts}}'
connection: local
remote_user: user
become_method: sudo
vars_files:
- varsfile.yml
tasks:
- name: starting ssh
service:
name: ssh
state: started
- name: starting syslog-ng
service:
name: syslog-ng
state: started
- user: name=user groups=sudo
- lineinfile: "dest=/etc/sudoers state=present regexp='^%sudo' line='%sudo ALL=(ALL) NOPASSWD: ALL'"
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/passwd state=present regexp='user' line='user:x:1000:1000::/home/user:/bin/bash'"
ignore_errors: yes
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/passwd state=present regexp='opensrf' line='opensrf:x:1002:1002::/home/opensrf:/bin/bash'"
ignore_errors: yes
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/passwd state=present regexp='evergreen' line='evergreen:x:1003:1003::/home/evergreen:/bin/bash'"
ignore_errors: yes
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/passwd state=present regexp='ubuntu' line='ubuntu:x:1004:1004:Ubuntu:/home/ubuntu:/bin/bash'"
ignore_errors: yes
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/passwd state=present regexp='mcoia' line='mcoia:x:1005:1005::/home/mcoia:/bin/bash'"
ignore_errors: yes
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/group state=present regexp='^user' line='user:x:1000:'"
ignore_errors: yes
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/group state=present regexp='^opensrf' line='opensrf:x:1002:'"
ignore_errors: yes
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/group state=present regexp='^evergreen' line='evergreen:x:1003:'"
ignore_errors: yes
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/group state=present regexp='^ubuntu' line='ubuntu:x:1004:'"
ignore_errors: yes
- name: Ensure User conformity
become: true
lineinfile: "dest=/etc/group state=present regexp='^mcoia' line='mcoia:x:1005:'"
ignore_errors: yes
- name: Setting Timezone
become: true
ignore_errors: yes
shell: echo America/Chicago > /etc/timezone
- name: Setting Timezone
become: true
ignore_errors: yes
shell: timedatectl set-timezone America/Chicago
- name: Chowning home directories
become: true
ignore_errors: yes
shell: chown -R user:user /home/user && chown -R evergreen:evergreen /home/evergreen && chown -R opensrf:opensrf /home/opensrf && chown -R ubuntu:ubuntu /home/ubuntu && chown -R mcoia:mcoia /home/mcoia
- name: Creating repo folder
become_user: opensrf
file: path=/home/opensrf/repos state=directory owner=opensrf group=opensrf mode=0775
- stat: path=/home/opensrf/repos/OpenSRF
register: opensrfgit
- stat: path=/home/opensrf/repos/Evergreen
register: evergreengit
- name: Cloning Opensrf git
when: opensrfgit.stat.isdir is not defined
become: true
become_user: opensrf
environment:
PATH: "{{ ansible_env.PATH }}:{{openils_path}}/bin"
shell: cd /home/opensrf/repos && git clone git://git.evergreen-ils.org/OpenSRF.git
- name: clone Evergreen repo
when: evergreengit.stat.isdir is not defined
become: true
become_user: opensrf
environment:
PATH: "{{ ansible_env.PATH }}:{{openils_path}}/bin"
shell: cd /home/opensrf/repos && git clone -b {{evergreen_git_branch}} git://git.evergreen-ils.org/working/Evergreen.git
- name: OpenSRF Checkout Branch
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/OpenSRF && git fetch --all && git pull && git checkout {{opensrf_git_branch}}
- name: OpenSRF Git Cherry pick loop Debug
become: true
become_user: opensrf
debug: msg="Cherry Picking {{ item }}"
with_items: "{{ OpenSRF_cherry_picks }}"
- name: OpenSRF Git Cherry pick loop
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/OpenSRF && git cherry-pick {{ item }}
with_items: "{{ OpenSRF_cherry_picks }}"
- name: Install OpenSRF prereqs
become: true
shell: apt-get update && cd /home/opensrf/repos/OpenSRF && export PERL_MM_USE_DEFAULT=1 && autoreconf -i && make -f src/extras/Makefile.install ubuntu-xenial && chown opensrf:opensrf -R .
- name: Make Opensrf as opensrf
become: true
become_user: opensrf
environment:
PATH: "{{ ansible_env.PATH }}:{{openils_path}}/bin"
shell: cd /home/opensrf/repos/OpenSRF && autoreconf -i && ./configure --prefix={{openils_path}} --sysconfdir={{openils_path}}/conf && make
- name: Make install OpenSRF
become: true
environment:
PATH: "{{ ansible_env.PATH }}:{{openils_path}}/bin"
shell: cd /home/opensrf/repos/OpenSRF && make install && chown -R opensrf:opensrf {{openils_path}}
- name: Setup host file
become: true
shell: cp /egconfigs/hosts /etc/hosts
ignore_errors: yes
- name: Ensure ejabberd private/public networks are accounted for in hosts file
become: true
shell: echo 127.0.1.2 public.localhost public >> /etc/hosts
- name: Ensure ejabberd private/public networks are accounted for in hosts file
become: true
shell: echo 127.0.1.3 private.localhost private >> /etc/hosts
- name: Add local IP to hosts
become: true
shell: echo {{ansible_all_ipv4_addresses.0}} {{ansible_fqdn}} {{ansible_hostname}} >> /etc/hosts
- name: Put the ejabberd config into place
become: true
shell: cp /egconfigs/ejabberd.yml /etc/ejabberd/ejabberd.yml
- name: Kill ejabberd
ignore_errors: yes
shell: "/bin/ps -ef | /bin/grep ejabber | /bin/grep -v apache | /bin/grep -v grep | /usr/bin/awk '{print $2}' | /usr/bin/xargs sudo kill -9"
- name: Starting ejabberd
service:
name: ejabberd
state: started
- name: Pausing for ejabberd
pause: seconds=2
- name: Setup ejabberd users
become: true
shell: ejabberdctl unregister router private.localhost && ejabberdctl unregister opensrf private.localhost && ejabberdctl unregister router public.localhost && ejabberdctl unregister opensrf public.localhost
- name: Setup ejabberd users
become: true
shell: ejabberdctl register router private.localhost {{ejabberd_password}} && ejabberdctl register opensrf private.localhost {{ejabberd_password}} && ejabberdctl register router public.localhost {{ejabberd_password}} && ejabberdctl register opensrf public.localhost {{ejabberd_password}}
- name: Copy example opensrf_core.xml
become: true
become_user: opensrf
shell: cp {{openils_path}}/conf/opensrf_core.xml.example {{openils_path}}/conf/opensrf_core.xml
- lineinfile: "dest={{openils_path}}/conf/opensrf_core.xml state=present regexp='<passwd>password</passwd>' line='<passwd>{{ejabberd_password}}</passwd>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf_core.xml state=present regexp='<passwd>password</passwd>' line='<passwd>{{ejabberd_password}}</passwd>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf_core.xml state=present regexp='<password>password</password>' line='<password>{{ejabberd_password}}</password>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf_core.xml state=present regexp='<password>password</password>' line='<password>{{ejabberd_password}}</password>'"
- name: Setup .srfsh.xml
become: true
become_user: opensrf
shell: cp {{openils_path}}/conf/srfsh.xml.example ~/.srfsh.xml && cp {{openils_path}}/conf/opensrf.xml.example {{openils_path}}/conf/opensrf.xml
- lineinfile: "dest=/home/opensrf/.srfsh.xml state=present regexp='<passwd>' line='<passwd>{{ejabberd_password}}</passwd>'"
- lineinfile: "dest=/home/opensrf/.bashrc state=present line='export PATH=$PATH:{{openils_path}}/bin'"
- name: Start Opensrf
become: true
become_user: opensrf
environment:
PATH: "{{ ansible_env.PATH }}:{{openils_path}}/bin"
shell: osrf_control --localhost --start-all
- stat: path=/tmp/apache-websocket
register: websocketsgit
- name: Start Clone websockets
become: true
shell: cd /tmp && git clone https://github.com/disconnect/apache-websocket
when: websocketsgit.stat.isdir is not defined
- name: Start websockets
become: true
shell: cd /tmp/apache-websocket && git fetch --all && git pull && git checkout master && apxs2 -i -a -c mod_websocket.c && sh /usr/share/doc/apache2/examples/setup-instance websockets && a2dismod websocket
ignore_errors: yes
- lineinfile: "dest=/etc/apache2-websockets/envvars state=present line='export OSRF_WEBSOCKET_IDLE_TIMEOUT=120'"
- lineinfile: "dest=/etc/apache2-websockets/envvars state=present line='export OSRF_WEBSOCKET_IDLE_CHECK_INTERVAL=5'"
- lineinfile: "dest=/etc/apache2-websockets/envvars state=present line='export OSRF_WEBSOCKET_CONFIG_FILE={{openils_path}}/conf/opensrf_core.xml'"
- lineinfile: "dest=/etc/apache2-websockets/envvars state=present line='export OSRF_WEBSOCKET_CONFIG_CTXT=gateway'"
- lineinfile: "dest=/etc/apache2-websockets/envvars state=present line='export OSRF_WEBSOCKET_MAX_REQUEST_WAIT_TIME=600'"
- lineinfile: "dest=/etc/apache2-websockets/envvars state=present regexp='APACHE_RUN_USER' line='export APACHE_RUN_USER=opensrf'"
- name: Copy Example Websockets apache2.conf
become: true
shell: cp /home/opensrf/repos/OpenSRF/examples/apache_24/websockets/apache2.conf /etc/apache2-websockets/
### OPENSRF IS FINISHED
### STARTING EVERGREEN SECTION
- name: Evergreen Git Add remote
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/Evergreen && git remote add -f working git://git.evergreen-ils.org/working/Evergreen.git
ignore_errors: yes
- name: Evergreen Git Add remote
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/Evergreen && git remote set-url --push working git@git.evergreen-ils.org:working/Evergreen.git
ignore_errors: yes
- name: Evergreen Git fetch all
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/Evergreen && git reset --hard && git checkout {{evergreen_git_branch}} && git config --global user.email "just_need_to_satisfy_git@yoyo.com" && git config --global user.name "checkoutuser"
- name: Evergreen Git Cherry pick loop Debug
become: true
become_user: opensrf
debug: msg="Cherry Picking {{ item }}"
with_items: "{{ Evergreen_cherry_picks }}"
- name: Evergreen Git Cherry pick loop
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/Evergreen && git cherry-pick {{ item }}
with_items: "{{ Evergreen_cherry_picks }}"
- name: Setup Evergreen prerequisites
become: true
shell: cd /home/opensrf/repos/Evergreen && make -f Open-ILS/src/extras/Makefile.install ubuntu-xenial
- name: Setup Evergreen prerequisites 2nd trip through
become: true
shell: cd /home/opensrf/repos/Evergreen && make -f Open-ILS/src/extras/Makefile.install ubuntu-xenial
- name: Setup Evergreen developer packages
become: true
shell: cd /home/opensrf/repos/Evergreen && make -f Open-ILS/src/extras/Makefile.install ubuntu-xenial-developer
### Install Database
- name: Setup Evergreen Postgres packages
become: true
shell: cd /home/opensrf/repos/Evergreen && make -f Open-ILS/src/extras/Makefile.install postgres-server-ubuntu-xenial
- name: Allow postgres to talk outside
become: true
lineinfile: "dest=/etc/postgresql/9.5/main/pg_hba.conf state=present regexp='host all evergreen' line='host all evergreen {{ansible_default_ipv4.network}} {{ansible_default_ipv4.netmask}} md5'"
- name: Setup postgresql.conf (if you have a custom file in /egconfigs)
become: true
ignore_errors: yes
shell: cp /egconfigs/postgresql.conf /etc/postgresql/9.5/main
- name: Ensure that plperl is installed
become: true
ignore_errors: yes
shell: apt-get -y install postgresql-plperl-9.5
- name: Disable transparent_hugepages in grub
become: true
ignore_errors: yes
lineinfile: dest=/etc/default/grub state=present regexp='GRUB_CMDLINE_LINUX_DEFAULT' line='GRUB_CMDLINE_LINUX_DEFAULT="transparent_hugepage=never"'
- name: Disable transparent_hugepages
become: true
ignore_errors: yes
shell: echo never > /sys/kernel/mm/transparent_hugepage/enabled
- name: i18n prereqs
become: true
shell: apt-get -y install translate-toolkit python-dev python-levenshtein python-polib python-setuptools python-simplejson python-lxml liblocale-maketext-lexicon-perl
- name: update PO files
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/Evergreen/build/i18n && mkdir locale && make newpot && make LOCALE=fr-CA updatepo && make LOCALE=es-ES updatepo && make LOCALE=cs-CZ updatepo && make LOCALE=ar-JO updatepo && make LOCALE=fr-CA install && make LOCALE=es-ES install && make LOCALE=cs-CZ install && make LOCALE=ar-JO install
- name: starting postgres
service:
name: postgresql
state: started
- name: Setup Evergreen database
become: true
become_user: postgres
shell: psql -c "CREATE ROLE {{ database_database }} PASSWORD '{{ database_password }}' SUPERUSER LOGIN INHERIT CREATEDB CREATEROLE"
### Change the password for "user"
- name: Change the password for "user"
become: true
shell: '/bin/echo -e "{{os_user_password}}\n{{os_user_password}}\n" | /usr/bin/passwd user'
- name: Running autoreconf on the git repo
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/Evergreen && autoreconf -i
- name: Setting up npm
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/Evergreen/Open-ILS/web/js/ui/default/staff/ && npm install && npm run build-prod && npm run test
- name: Setting up eg2
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/Evergreen/Open-ILS/src/eg2/ && npm install && npm run build --prod && npm run test
- name: Configuring Evergreen code and make
become: true
become_user: opensrf
shell: cd /home/opensrf/repos/Evergreen && PATH={{openils_path}}/bin:$PATH ./configure --prefix={{openils_path}} --sysconfdir={{openils_path}}/conf && make
- name: Install Evergreen
become: true
shell: cd /home/opensrf/repos/Evergreen && make install
- file: path={{openils_path}}/var/web/xul/server state=absent
- name: Setup Symlink {{openils_path}}/var/web/xul/server
become: true
shell: cd {{openils_path}}/var/web/xul && ln -sf {{evergreen_stamp_id}}/server server && chown -R opensrf:opensrf {{openils_path}}
- name: Dojoify
become: true
become_user: opensrf
shell: cd /home/opensrf && wget http://download.dojotoolkit.org/release-1.3.3/dojo-release-1.3.3.tar.gz && tar -C {{openils_path}}/var/web/js -xzf dojo-release-1.3.3.tar.gz && cp -r {{openils_path}}/var/web/js/dojo-release-1.3.3/* {{openils_path}}/var/web/js/dojo/.
- name: Copy default Evergreen apache configs
become: true
shell: cd /home/opensrf/repos/Evergreen && cp Open-ILS/examples/apache_24/eg_24.conf /etc/apache2/sites-available/eg.conf && cp Open-ILS/examples/apache_24/eg_vhost_24.conf /etc/apache2/eg_vhost.conf && cp Open-ILS/examples/apache_24/eg_startup /etc/apache2/
- file: path=/etc/apache2/ssl state=directory
- name: Setup SSL Certs
become: true
shell: cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key -subj "/C=US/ST=MO/L=Columbia/O=MOBIUS/OU=IT Department/CN={{domain_name}}"
- lineinfile: "dest=/etc/apache2/sites-available/eg.conf state=present regexp='Require host 10.0.0.0\\/8' line='Require all granted'"
- lineinfile: "dest=/etc/apache2/envvars state=present regexp='APACHE_RUN_USER' line='export APACHE_RUN_USER=opensrf'"
- lineinfile: "dest=/etc/apache2/apache2.conf state=present regexp='KeepAliveTimeout' line='KeepAliveTimeout 1'"
- lineinfile: "dest=/etc/apache2/apache2.conf state=present regexp='MaxKeepAliveRequests' line='MaxKeepAliveRequests 100'"
- lineinfile: "dest=/etc/apache2/mods-available/mpm_prefork.conf state=absent regexp='MaxConnectionsPerChild'"
- lineinfile: "dest=/etc/apache2/mods-available/mpm_prefork.conf state=present regexp='StartServers' line='StartServers 20'"
- lineinfile: "dest=/etc/apache2/mods-available/mpm_prefork.conf state=present regexp='MinSpareServers' line='MinSpareServers 5'"
- lineinfile: "dest=/etc/apache2/mods-available/mpm_prefork.conf state=present regexp='MaxSpareServers' line='MaxSpareServers 15'"
- lineinfile: dest=/etc/apache2/mods-available/mpm_prefork.conf state=present insertbefore='<\/IfModule>' line='MaxClients 150'
- lineinfile: dest=/etc/apache2/mods-available/mpm_prefork.conf state=present insertbefore='<\/IfModule>' line='MaxRequestsPerChild 10000'
- name: copy custom eg.conf (if exists)
become: true
ignore_errors: yes
shell: cp /egconfigs/eg.conf /etc/apache2/sites-available/eg.conf
- name: copy custom eg_vhost.conf (if exists)
become: true
ignore_errors: yes
shell: cp /egconfigs/eg_vhost.conf /etc/apache2/eg_vhost.conf
- lineinfile: "dest=/etc/apache2/eg_vhost.conf state=present regexp='OSRFTranslatorCacheServer' line='OSRFTranslatorCacheServer {{opensrf_memcached_server}}:{{opensrf_memcached_port}}'"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: PerlAddVar OILSWebLocale "fr_ca"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: PerlAddVar OILSWebLocale "/openils/var/data/locale/opac/fr-CA.po"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: PerlAddVar OILSWebLocale "es_es"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: PerlAddVar OILSWebLocale "/openils/var/data/locale/opac/es-ES.po"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: PerlAddVar OILSWebLocale "ar_jo"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: PerlAddVar OILSWebLocale "/openils/var/data/locale/opac/ar-JO.po"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: PerlAddVar OILSWebLocale "cs_cz"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: PerlAddVar OILSWebLocale "/openils/var/data/locale/opac/cs-CZ.po"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: PerlAddVar OILSWebDefaultLocale "es_es"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: RewriteCond %{REQUEST_URI} ^/eg2/
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: RewriteCond %{REQUEST_URI} !^/eg2/fr-CA/
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: RewriteCond %{HTTP_COOKIE} eg_locale=fr_ca
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
line: RewriteRule ^/eg2/(.*) https://%{HTTP_HOST}/eg2/fr-CA/$1 [R=307,L]
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
insertafter: . sample staff-specific translation files
line: PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/es-ES.po"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
insertafter: . sample staff-specific translation files
line: PerlAddVar OILSWebLocale "es_es"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
insertafter: . sample staff-specific translation files
line: PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/ar-JO.po"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
insertafter: . sample staff-specific translation files
line: PerlAddVar OILSWebLocale "ar_jo"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
insertafter: . sample staff-specific translation files
line: PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/cs-CZ.po"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
insertafter: . sample staff-specific translation files
line: PerlAddVar OILSWebLocale "cs-cz"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
insertafter: . sample staff-specific translation files
line: PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/fr-CA.po"
- lineinfile:
dest: /etc/apache2/eg_vhost.conf
insertafter: . sample staff-specific translation files
line: PerlAddVar OILSWebLocale "fr-ca"
- name: Enable apache prefork module and evergreen default apache site
become: true
shell: /usr/sbin/a2dismod mpm_event && /usr/sbin/a2enmod mpm_prefork && /usr/sbin/a2ensite eg.conf && chown opensrf /var/lock/apache2
- name: Copy opensrf example files to {{openils_path}}/conf
become: true
shell: cp -b {{openils_path}}/conf/opensrf_core.xml.example {{openils_path}}/conf/opensrf_core.xml && cp -b {{openils_path}}/conf/opensrf.xml.example {{openils_path}}/conf/opensrf.xml
- lineinfile: "dest={{openils_path}}/conf/opensrf_core.xml state=present regexp='<passwd>password</passwd>' line='<passwd>{{ejabberd_password}}</passwd>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf_core.xml state=present regexp='<passwd>password</passwd>' line='<passwd>{{ejabberd_password}}</passwd>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf_core.xml state=present regexp='<password>password</password>' line='<password>{{ejabberd_password}}</password>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf_core.xml state=present regexp='<password>password</password>' line='<password>{{ejabberd_password}}</password>'"
## Starting to edit {{openils_path}}/conf/opensrf.xml if use_custom_opensrf_xml is false
- block:
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<sender_address>evergreen@localhost' line='<sender_address>{{sender_address}}</sender_address>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<sender_address>evergreen@localhost' line='<sender_address>{{sender_address}}</sender_address>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<base_uri>https://localhost/reporter/</base_uri>' line='<base_uri>{{base_reporter_uri}}</base_uri>'"
## update ALL of the database hostnames
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<host>localhost</host>' line='<host>{{database_host}}</host>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<host>localhost</host>' line='<host>{{database_host}}</host>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<host>localhost</host>' line='<host>{{database_host}}</host>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<host>localhost</host>' line='<host>{{database_host}}</host>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<host>localhost</host>' line='<host>{{database_host}}</host>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<host>localhost</host>' line='<host>{{database_host}}</host>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<host>localhost</host>' line='<host>{{database_host}}</host>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<host>localhost</host>' line='<host>{{database_host}}</host>'"
## update ALL of the database ports
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<port>5432</port>' line='<port>{{database_port}}</port>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<port>5432</port>' line='<port>{{database_port}}</port>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<port>5432</port>' line='<port>{{database_port}}</port>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<port>5432</port>' line='<port>{{database_port}}</port>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<port>5432</port>' line='<port>{{database_port}}</port>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<port>5432</port>' line='<port>{{database_port}}</port>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<port>5432</port>' line='<port>{{database_port}}</port>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<port>5432</port>' line='<port>{{database_port}}</port>'"
## update ALL of the database database lines
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<db>evergreen</db>' line='<db>{{database_database}}</db>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<db>evergreen</db>' line='<db>{{database_database}}</db>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<db>evergreen</db>' line='<db>{{database_database}}</db>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<db>evergreen</db>' line='<db>{{database_database}}</db>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<db>evergreen</db>' line='<db>{{database_database}}</db>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<db>evergreen</db>' line='<db>{{database_database}}</db>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<db>evergreen</db>' line='<db>{{database_database}}</db>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<db>evergreen</db>' line='<db>{{database_database}}</db>'"
## update ALL of the database user lines
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<user>postgres</user>' line='<user>{{database_user}}</user>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<user>postgres</user>' line='<user>{{database_user}}</user>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<user>postgres</user>' line='<user>{{database_user}}</user>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<user>postgres</user>' line='<user>{{database_user}}</user>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<user>postgres</user>' line='<user>{{database_user}}</user>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<user>postgres</user>' line='<user>{{database_user}}</user>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<user>postgres</user>' line='<user>{{database_user}}</user>'"
## update ALL of the database password lines
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<pw>postgres</pw>' line='<pw>{{database_password}}</pw>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<pw>postgres</pw>' line='<pw>{{database_password}}</pw>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<pw>postgres</pw>' line='<pw>{{database_password}}</pw>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<pw>postgres</pw>' line='<pw>{{database_password}}</pw>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<pw>postgres</pw>' line='<pw>{{database_password}}</pw>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<pw>postgres</pw>' line='<pw>{{database_password}}</pw>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<pw>postgres</pw>' line='<pw>{{database_password}}</pw>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<output_base>{{openils_path}}/var/web/reporter</output_base>' line='<output_base>{{reporter_output_folder}}</output_base>'"
- lineinfile: "dest={{openils_path}}/conf/opensrf.xml state=present regexp='<server>127.0.0.1:11211</server>' line='<server>{{opensrf_memcached_server}}:{{opensrf_memcached_port}}</server>'"
when: use_custom_opensrf_xml == false
become: true
become_user: opensrf
- name: Copy custom opensrf {{openils_path}}/conf {{ use_custom_opensrf_xml }}
when: use_custom_opensrf_xml == true
become: true
shell: cp /egconfigs/opensrf.xml {{openils_path}}/conf && chown opensrf:opensrf {{openils_path}}/conf/opensrf.xml
- name: Owning apache2 pid file
become: true
shell: chown opensrf /var/lock/apache2*
ignore_errors: yes
- name: Disable the default apache sites
become: true
ignore_errors: yes
shell: /usr/sbin/a2dissite default-ssl && /usr/sbin/a2dissite 000-default
- lineinfile: "dest=/etc/apache2-websockets/apache2.conf state=present regexp='SSLCertificateFile' line='SSLCertificateFile /etc/apache2/ssl/server.crt'"
- lineinfile: "dest=/etc/apache2-websockets/apache2.conf state=present regexp='SSLCertificateKeyFile' line='SSLCertificateKeyFile /etc/apache2/ssl/server.key'"
## Evergreen is installed
## Installing SIP
- name: Install Socket::Linux
become: true
shell: export PERL_MM_USE_DEFAULT=1 && perl -MCPAN -e 'install Socket::Linux'
- name: chown /opt
become: true
file: path=/opt state=directory owner=opensrf group=opensrf mode=0775
- stat: path=/opt/SIPServer
register: sipgit
- name: Clone SIPServer repo
when: sipgit.stat.isdir is not defined
become: true
become_user: opensrf
shell: cd /opt && git clone git://git.evergreen-ils.org/SIPServer.git SIPServer
- name: Git SIPServer Add remote
become: true
become_user: opensrf
shell: cd /opt/SIPServer && git remote add working git://git.evergreen-ils.org/working/SIPServer.git
ignore_errors: yes
- name: Git SIPServer Add remote
become: true
become_user: opensrf
shell: cd /opt/SIPServer && git remote set-url --push working git@git.evergreen-ils.org:working/SIPServer.git
ignore_errors: yes
- name: Git SIPServer fetch all
become: true
become_user: opensrf
shell: cd /opt/SIPServer && git checkout master && git fetch --all && git pull
- name: Git SIPServer Checkout the "Good" Branch
become: true
become_user: opensrf
shell: cd /opt/SIPServer && git reset --hard && git config --global user.email "just_need_to_satisfy_git@yoyo.com" && git config --global user.name "checkoutuser"
- name: Git SIPServer Cherry pick loop
become: true
become_user: opensrf
shell: cd /opt/SIPServer && git cherry-pick {{ item }}
with_items: "{{ SIPServer_cherry_picks }}"
- name: copy the oils_sip.xml
become: true
shell: cp {{ openils_path }}/conf/oils_sip.xml.example {{ openils_path }}/conf/oils_sip.xml && chown opensrf:opensrf -R {{ openils_path }}
- lineinfile: dest={{ openils_path }}/conf/oils_sip.xml state=present regexp='<login id="scclient" password="clientpwd"' line='<login id="{{evergreen_global_admin}}" password="{{evergreen_global_admin_password}}" institution="sample"/>'
- lineinfile: dest={{ openils_path }}/conf/oils_sip.xml state=present regexp='<institution id="gapines" implementation="OpenILS::SIP">' line='<institution id="sample" implementation="OpenILS::SIP">'
## Compile staff client
- name: Install nsis
apt: name=nsis
- name: Install zip
apt: name=zip
- name: Make opensrf the owner
become: true
shell: chown -R opensrf:opensrf /home/opensrf/repos
## Setup sendmail
- name: Restart sendmail
become: true
shell: /etc/init.d/sendmail restart
### Setup EG concerto database
- name: Setup EG concerto database
become: true
shell: cd /home/opensrf/repos/Evergreen && perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all --create-database --create-schema --create-offline --user {{ database_user }} --password {{ database_password }} --hostname {{ database_host }} --port {{ database_port }} --database {{ database_database }} --admin-user {{ evergreen_global_admin }} --admin-pass {{ evergreen_global_admin_password }} --load-all-sample
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.