Coder Social home page Coder Social logo

santandermetgroup / ansible-thredds-cluster Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 5.0 7.72 MB

Ansible playbooks for deployment of THREDDS server cluster

Shell 39.24% Ruby 60.76%
ansible ansible-playbook ansible-roles apache2 centos cluster redhat reverse-proxy supervisord thredds tomcat vagrant

ansible-thredds-cluster's People

Contributors

cofinoa avatar pablo-cc avatar soniafernandez avatar zequihg50 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-thredds-cluster's Issues

Allow collections to be accessed through multiple paths

This would allow catalog tree hierarchies to define multiple <datasetRoot>. Actually they are restricted to one. This requires to add the appropriate entries in the corresponding gateways.

collections:
  - &collection1
    name: collection1
    path: [path1,path2,path3]
    catalogs: data/collection1
    services: [catalog, fileServer, dodsC]

tomcat_major_version variable needed in tomcat-memcached role

Role: tomcat-memcached

In two default variables of the role tds_\major_version needs to be defined previously by installing with either yum or source roles.

Use facts to load workers on the proxy

Instead of the current process of manually connect to hosts and execute the update_proxy.py script, try to find a way to add workers using a playbook from the control machine, discovering facts from the hosts (saved in .json files) and adding them into the proxy using delegate_to.

Allow deployment model to reference tds_instances and collections using their name

Currently we use YAML anchors to reference tds_instances and collections in the replicas dict of the deployment model. This requires collections and tds_instances dicts to be defined in the same yaml file where replicas are defined. This is unwanted behavior since there are scenarios where all the hosts share the same collections but the replicas dict differ and this force us to copy the collections dict in both yaml files.

Example:

tomcat_base: '/usr/local'

collections:
  - &collection1
    name: collection1
    path: collection1
    catalogs:
      src: catalogs/collection1
    services: [dodsC, fileServer, catalog]

  - &collection2
    name: collection2
    path: collection2
    catalogs:
      src: catalogs/collection2
    services: [dodsC, fileServer, catalog]

tds:
  - &tomcat
    name: tomcat
    tds_content_root: /esg/content

replicas:
  - gateway: esgf
    host: "{{ ansible_eth1.ipv4.address }}"
    route: "{{ ansible_nodename }}"
    port: 8223
    tds_instance: *tomcat
    collection: *collection1
tds_version: 5.0.0

collections:
  - &collection1
    name: collection1
    path: collection1
    catalogs:
      src: catalogs/collection1
    services: [dodsC, fileServer, catalog]

  - &collection2
    name: collection2
    path: collection2
    catalogs:
      src: catalogs/collection2
    services: [dodsC, fileServer, catalog]

tds:
  - &backend_instance
    name: instance1
    connectors:
      - port: 8223
        protocol: AJP/1.3

replicas:
  - gateway: esgf
    host: "{{ ansible_eth1.ipv4.address }}"
    port: 8223
    route: "{{ ansible_nodename }}"
    tds_instance: *backend_instance
    collection: *collection1

  - gateway: esgf
    host: "{{ ansible_eth1.ipv4.address }}"
    port: 8223
    route: "{{ ansible_nodename }}"
    tds_instance: *backend_instance
    collection: *collection2

Ideal behavior would be to refer to the tds_instance and collection using their name. However this requires, to all the tasks that loop over the replicas, to discover the appropriate dict using the name key and its value, e.g.

- name: Create directories for collections in instances 
  file:
    dest: "{{ instance.tds_content_root | default(tomcat_base ~ '/' ~ instance.name ~ '/content') }}/thredds/{{ collection.path }}"
    state: directory
  with_items: "{{ replicas }}"
  vars:
    collection: "{{ collections | selectattr('name', 'equalto', 'collection1') | first }}"
    instance: "{{ tds | selectattr('name', 'equalto', 'instance1') | first }}"

Modules not found when working with httpd 2.2

  • Roles: httpd
  • OS: CentOS/6
  • httpd version: 2.2

When trying to start httpd v2.2 with the template provided by the role httpd this error message pops out:

httpd: Syntax error on line 9 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_access_compat.so into server: /etc/httpd/modules/mod_access_compat.so: cannot open shared object file: No such file or directory

After commenting out line 9 (i.e. stop loading the module mod_access_compat.so) the following error pops out:

httpd: Syntax error on line 11 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_authn_core.so into server: /etc/httpd/modules/mod_authn_core.so: cannot open shared object file: No such file or directory

After commenting out both lines, httpd is able to start and seems to work fine (not sure about this)

mod_access_compat.so Documentation

mod_acces_compat.so
Compatibility: | Available in Apache HTTP Server 2.3 as a compatibility module with previous versions of Apache httpd 2.x. The directives provided by this module have been deprecated by the new authz refactoring. Please see mod_authz_host

mod_authn_core.so Documentation

mod_authn_core.so
Compatibility: | Available in Apache 2.3 and later

Allow collections to include existing datasets in remote hosts into the main catalog

collections:
  - &collection1
    name: collection1
    path: collection1 # Id of the collection and logical path in THREDDS
    catalogs: /data/collection1
    services: [catalog, fileServer, dodsC]
    datasets:
      - content: |
           <datasetScan name="NCEP Data" path="ncep" location="/data/ldm/pub/native/grid/NCEP/">
             <metadata inherited="true">
               <serviceName>fileserver</serviceName>
               <authority>meteo.unican.es</authority>
               <dataType>Grid</dataType>
             </metadata>
           </datasetScan> 

The content of every dataset will be rendered into the main catalog of the collection, before the </catalog> tag.

Change ajp field from tomcat_instances to connectors

  - name: Deploy tds
    hosts: tds4gws
    vars_files: 
      - tds4gws-secret.yml
    vars:
      tomcat_instances:
        - name: tds4gws_1800
          base_port: 1800
          ajp: 
            port: 18009
            proxyPort: 8008
            proxyName: 192.168.33.12
          gws_instance: 
            - name: "{{ gws.0.name }}"

should be:

  - name: Deploy tds
    hosts: tds4gws
    vars_files: 
      - tds4gws-secret.yml
    vars:
      tomcat_instances:
        - name: tds4gws_1800
          base_port: 1800
          shutdown: ...
          connectors:
            - type: ajp # mandatory
              port: 18009
              proxyPort: 8008
              proxyName: 192.168.33.12
            - type: http
              port: ...
              proxyPort: ...
              proxyName: hostname/ip or ip only? -> hostname, use it in httpd <VirtualHost>
          gws_instance: 
            - name: "{{ gws.0.name }}"

ip_address of tomcat_instances vars should be replaced with ansible host ip

The following configuration shows an example of a deployment of two hosts that should be implemented in two different plays since the ip_address couples the play to the host being deployed by Ansible. It should be replaced by the ip used by Ansible to allow identical hosts to be deployed in the same play.

- name: Deploy worker1
  hosts: worker1
  vars_files: 
    - workers-secret.yml
  vars:
    tomcat_install_from_source: true
    tomcat_system: false
    proxyPort: 8008
    tomcat_instances:
      - name: worker1_1800 -> dynamic ({{ whatever }})
        base_port: 1800
        ip_address: 192.168.50.12 -> dynamic ({{ whatever }})
        gws_instance: 
          - name: "{{ gws.0.name }}"
    gws:
      - name: gws1
        path: gws1/test
        location: "/group_workspaces/jasmin/gws1"

  roles:
    - role: tds 

- name: Deploy worker2
  hosts: worker2
  vars_files:
    - workers-secret.yml
  vars:
    tomcat_install_from_source: true
    tomcat_system: false
    proxyPort: 8008
    tomcat_instances:
      - name: worker1_1800
        base_port: 1800
        ip_address: 192.168.50.13
        gws_instance: 
          - name: "{{ gws.0.name }}"
    gws:
      - name: gws1
        path: gws1/test
        location: "/group_workspaces/jasmin/gws1"
  roles:
    - role: tds 

Refactoring of the 'lib' role

The 'lib' role, inside the roles folder, is actually used from other roles to perform specific tasks, instead of being a role per se, creating a dependency from roles that make use of it. Should it be refactored and its functionality included in the corresponding role?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.