Ignore:
Timestamp:
2024-01-12T10:43:01+13:00 (5 months ago)
Author:
davidb
Message:

Further refinement of playback as a result of testing

Location:
main/trunk/greenstone3/src/ansible-playbooks
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/ansible-playbooks/greenstone3-svn-playbook.yml

    r38523 r38524  
     1# Self-contained Ansible playbook to install required Unix
     2# command-line packages, and then configure, compile and install
     3# Greenstone3
     4
     5# Playbook currently designed to be run on computer where the
     6# Greenstone installation is to occur (i.e., localhost)
     7
     8# To install ansible:
     9#     sudo apt update
     10#     sudo apt install software-properties-common
     11#     sudo add-apt-repository --yes --update ppa:ansible/ansible
     12#     sudo apt install ansible
     13
     14# To run this playbook to svn checkout Greenstone3 and compile it up:
     15#
     16#     ansible-playbook -l localhost -u $USER ./greenstone3-svn-playbook.yml
     17
    118---
     19
     20- name:       Installing required command-line tools
     21  hosts:      localhost
     22  connection: local
     23
     24  ####
     25  # Edit variable values below as needed
     26  ####
     27  vars:
     28    # gsdl3srchome: /home/{{ ansible_user }}/greenstone3-svn
     29    # gsdl3srchome: /mnt/<mydisk>/greenstone3-svn
     30    gsdl3srchome: /mnt/intermuse/greenstone3-ansible-svn   
     31    gsdl3port:     8383
     32
     33  tasks:
     34    - name: Setting gsdl3srchome
     35      set_fact: gsdl3srchome="{{ gsdl3srchome }}"
     36    - debug: msg="{{ hostvars['localhost']['gsdl3srchome'] }}"
     37   
     38    - name: Setting gsdl3port
     39      set_fact: gsdl3port="{{ gsdl3port }}"
     40    - debug: msg="{{ hostvars['localhost']['gsdl3port'] }}"
     41   
     42
     43- name:       Installing required command-line tools
     44  hosts:      localhost
     45  connection: local
     46  become:     true
     47
     48  tasks:
     49    - name: Changing Ansible to use 'aptitude' as package installation manager
     50      apt: name=aptitude update_cache=yes state=latest force_apt_get=yes
     51
     52    - name: Ensure that existing packages are up-to-date (within last 30 mins)
     53      apt: update_cache=yes state=latest force_apt_get=yes cache_valid_time=1800
     54
     55    - name: Install prerequisites
     56      apt: name={{ item }} update_cache=yes state=latest
     57      loop: [
     58        'subversion', 'build-essential', 'wget',
     59
     60        # As well as using 'unzip', the greenstone3 compile sequence currently uses
     61    # 'zip' in a handful of places, such as:
     62    #     <gsdl3srchome>/gli/makejar.sh
     63        'zip', 'unzip',
     64
     65        # Choosing to install the latest, rather than work with the one included
     66        # as an Greenstone3 extension, as that latter is getting a bit old
     67        'imagemagick',
     68       
     69        # The following needed for WebSwing on a headless server
     70        'libxrender1', 'libxtst6', 'libxi6', 'xvfb',
     71
     72        # The following are nice to have in general
     73        'plocate', 'emacs-nox'
     74      ]
     75
    276- hosts:      localhost
    377  connection: local
    478  vars:
    5     # gsdl3srchome: /home/{{ ansible_user }}/greenstone3-svn
    6     gsdl3srchome: /mnt/intermuse/greenstone3-ansible2-svn   
    7 #  vars_files:
    8 #    - vars/default.yml
    9 
     79    # #gsdl3srchome: /home/{{ ansible_user }}/greenstone3-svn
     80    # # # gsdl3srchome: /mnt/<mydisk>/greenstone3-svn   
     81    # # gsdl3port:     8383
     82    # gsdl3srchome: {{ hostvars['localhost']['gsdl3srchome'] }}
     83    # gsdl3port:    {{ hostvars['localhost']['gsdl3port'] }}
     84   
    1085  tasks:
    1186  - name: Subversion checkout of Greenstone3
     
    26101  #   https://stackoverflow.com/questions/60209185/ansible-environment-variables-from-env-file
    27102  #
    28 #  - name: Source Greenstone3's SETUP.bash I
     103#  - name: Source Greenstone3's SETUP.bash  using newer ./SETUP-ENV.sh (Ultimately new appoach not needed)
    29104#    ansible.builtin.command: ./SETUP-ENV.sh
    30105#    args:
     
    32107#    register:   env_file_result
    33108
    34 #  - name: Source Greenstone3's SETUP.bash (command)
     109#  - name: Deprecated 'source' Greenstone3's SETUP.bash (command)
    35110#    ansible.builtin.command:
    36111#      # executable: /bin/bash
     
    66141    environment: "{{ env_vars }}"
    67142     
     143#  - name: Prepare Greenstone3 (Compliated appoach using 'expect')
     144#    ansible.builtin.expect:
     145#      chdir:       "{{ gsdl3srchome }}"
     146#      command:     ant prepare
     147#      timeout:     null
     148#      responses:
     149#        "\\[input\\]\\s+\\(y, n\\)": "y"
     150#    environment: "{{ env_vars }}"
     151
     152
    68153  - name: Prepare Greenstone3
    69     ansible.builtin.expect:
    70       chdir:       "{{ gsdl3srchome }}"
    71       command:     ant prepare
    72       timeout:     null
    73       responses:
    74         "\\[input\\]\\s+\\(y, n\\)": "y"
     154    ansible.builtin.command:
     155      chdir:             "{{ gsdl3srchome }}"
     156      stdin:             "y"
     157      stdin_add_newline: true
     158      cmd:               ant prepare
    75159    environment: "{{ env_vars }}"
    76160
    77161
    78162
    79 #  - name: Prepare Greenstone3 II
     163#  - name: Prepare Greenstone3 II (untested)
    80164#    ansible.builtin.shell: |
    81165#      cd {{ gsdl3srchome }}
Note: See TracChangeset for help on using the changeset viewer.