Add name definitions for all steps
authorBen Shum <ben@evergreener.net>
Fri, 14 Apr 2017 16:36:52 +0000 (12:36 -0400)
committerBen Shum <ben@evergreener.net>
Fri, 14 Apr 2017 16:54:47 +0000 (12:54 -0400)
This aids the user in understanding what is being run at each step
of the setup process.

Also, if a user were to use --steps to go through each step one at
a time, this would allow them to know what step was about to happen
next.

Signed-off-by: Ben Shum <ben@evergreener.net>
evergreen/apache.yml
evergreen/eg-build.yml
evergreen/eg-install.yml
evergreen/eg-web.yml
extras/nginx.yml
extras/rsyslog.yml
opensrf/ejabberd.yml
opensrf/opensrf.yml
opensrf/setup.yml
opensrf/websockets.yml

index 0da1f81..d8b0adc 100644 (file)
@@ -1,34 +1,50 @@
 # 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'
index 9a114bd..465ec93 100644 (file)
@@ -10,7 +10,8 @@
     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
@@ -21,4 +22,5 @@
     && 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
index 017643f..618cc03 100644 (file)
     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
index d447313..2a75acc 100644 (file)
@@ -3,7 +3,8 @@
     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
index 01c01bf..47d9f55 100644 (file)
@@ -1,18 +1,22 @@
 # 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'
index 1cef2be..5df0656 100644 (file)
     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>'
index 9bf1e11..9574044 100644 (file)
@@ -5,12 +5,21 @@
     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}}
index 506eeb2..76da12a 100644 (file)
@@ -10,7 +10,8 @@
     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
@@ -25,4 +26,5 @@
   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
index 94288b9..67ba956 100644 (file)
@@ -9,7 +9,8 @@
     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}}'
index 94e6127..ac55a4c 100644 (file)
@@ -4,14 +4,16 @@
     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'