Ignore:
Timestamp:
2024-01-12T16:39:26+13:00 (5 months ago)
Author:
davidb
Message:

Adding in shared variables to ansible playbook

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

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/ansible-playbooks/01-RUN-ANSIBLE-BASE-INSTALL.sh

    r38531 r38535  
    11#!/bin/bash
    22
    3 ansible-playbook -l localhost -u $USER greenstone3-svn-playbook.yml
     3. ./_local_config.bash
     4
     5ansible-playbook -l localhost -u $localhost_username greenstone3-svn-playbook.yml
  • main/trunk/greenstone3/src/ansible-playbooks/greenstone3-svn-playbook.yml

    r38530 r38535  
    11# Self-contained Ansible playbook to install required Unix
    22# command-line packages, and then configure, compile and install
    3 # Greenstone3
     3# a basic Greenstone3, running tomcat over http, and accessed
     4# directly, e.g. http://localhost:8383/greenstone3/library
     5
    46
    57# Playbook currently designed to be run on computer where the
     
    2325
    2426  ####
    25   # Edit variable values below as needed
     27  # Review and edit as needed the variables in the following file
    2628  ####
    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
     29  vars_files:
     30    - vars/default-core.yml
     31   
     32#  ####
     33#  # Edit variable values below as needed
     34#  ####
     35#  vars:
     36#    gsdl3srchome: /home/{{ ansible_user }}/greenstone3-svn
     37#    # gsdl3srchome: /mnt/<mydisk>/greenstone3-svn
     38#    # gsdl3srchome: /mnt/intermuse/greenstone3-ansible-svn
     39#    gsdl3port:     8383
    3240
    3341  tasks:
     
    3947      set_fact: gsdl3port="{{ gsdl3port }}"
    4048    - debug: msg="gsdl3port = {{ hostvars['localhost']['gsdl3port'] }}"
    41    
     49
     50    - name: Setting gsdl3ports
     51      set_fact: gsdl3ports="{{ gsdl3ports }}"
     52    - debug: msg="gsdl3ports = {{ hostvars['localhost']['gsdl3ports'] }}"
    4253
    4354- name:       Installing required command-line tools
     
    7687- hosts:      localhost
    7788  connection: local
    78   vars:
    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'] }}
     89  vars_files:
     90    - vars/default-core.yml
    8491   
    8592  tasks:
     
    153160      line: localhost.port.http={{ gsdl3port }}
    154161
     162  - name: Setting ports in build.properties
     163    ansible.builtin.lineinfile:
     164      path:   "{{ gsdl3srchome }}/build.properties"
     165      regexp: '^{{ item }}='
     166      line:   "{{ item }}={{ hostvars['localhost']['gsdl3ports'][item] }}"
     167    with_items:
     168      - "localhost.port.http"
     169      - "tomcat.shutdown.port"
     170      - "tomcat.ajp.port"
     171      - "derby.server.port"
     172      - "tomcat.port.https"
     173
    155174  - name: Prepare Greenstone3
    156175    ansible.builtin.command:
Note: See TracChangeset for help on using the changeset viewer.