Skip to content

Commit

Permalink
Add conf_options parameter fo each db
Browse files Browse the repository at this point in the history
  • Loading branch information
loraine-gueguen committed Aug 5, 2024
1 parent c8909e2 commit 6e3350a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Each database is defined as a dictionary of the following parameters:
- `group` Optional. Useful if the database needs restricted access. An LDAP group ("gid"). LDAP users who are member of this group will have access to the database.
- `web_page_title` Optional. The title displayed at the top of the web page. If not provided, the default title is "BLAST server for `name`".
- `placeholders` Optional. A list of placeholder dictionaries `{key: 'key_item', value: 'value_item'}` that are used to customize top or bottom supplementary HTML code (see `sequenceserver_top_web_page_html_path` and `sequenceserver_bottom_web_page_html_path`). For example `placeholders: [{key: 'key1', value: 'value1'}, {key: 'key2', value: 'value2'}]`.
- `conf_options` Optional. A list of supplementary SequenceServer configuration options dictionaries `{key: 'key_item', value: 'value_item'}` (see [SequenceServer documentation](https://sequenceserver.com/doc/#basics)). For example `conf_options: [{key: 'job_lifetime', value: '10080'}, {key: 'databases_widget', value: 'tree'}]`.
Unique `name` and `port` are mandatory for each database.
`users`, `ldap_businesscategory` and `group` are optional and can be used to add an authentication layer with the nginx-auth-ldap module. Choose one single authentication mode for each database.
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ sequenceserver_blast_db:
# users: ['fbar','jsmith']
# web_page_title: 'blablabla'
# placeholders: [{key: 'key1', value: 'value1'}, {key: 'key2', value: 'value2'}]
# conf_options: [{key: 'job_lifetime', value: '10080'}, {key: 'databases_widget', value: 'tree'}]

# NCBI BLAST and SLURM variables
# Used in the slurm bash scripts
Expand Down
1 change: 1 addition & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
port: '4567'
path: '/tmp/test-data'
placeholders: [{key: 'key_string', value: 'value1'}, {key: 'key_link', value: '<a href="http://testplaceholder.com">my favorite link</a>'}]
conf_options: [{key: 'job_lifetime', value: '10080'}, {key: 'databases_widget', value: 'tree'}]
sequenceserver_top_web_page_html_path: "/tmp/top_web_page.html"
sequenceserver_bottom_web_page_html_path: "/tmp/bottom_web_page.html"
sequenceserver_home_url: "http://myfavoritewebsite.com"
Expand Down
11 changes: 11 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,14 @@
set_fact:
grep_slurm_batch: "{{ lib_modified_for_hpc_integration.content | b64decode | regex_findall('slurm_sbatch.sh') | first }}"
failed_when: grep_slurm_batch != 'slurm_sbatch.sh'
- name: Get the SequenceServer configuration file of my_db
slurp:
src: "/etc/sequenceserver/config/sequenceserver.my_db.conf"
register: my_db_conf
- name: Display content of the SequenceServer configuration file of my_db
debug:
msg: "{{ my_db_conf.content | b64decode }}"
- name: Check that conf_option is in the SequenceServer configuration file of my_db
set_fact:
grep_slurm_batch: "{{ my_db_conf.content | b64decode | regex_findall('databases_widget') | first }}"
failed_when: grep_slurm_batch != 'databases_widget'
7 changes: 7 additions & 0 deletions templates/sequenceserver.conf.j2
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
:port: '{{ item.port }}'
:database_dir: '{{ item.path }}'
{% if item.conf_options is defined and item.conf_options %}
{% for option in item.conf_options %}
{% if option.key is defined and option.key and option.value is defined and option.value %}
:{{ option.key }}: '{{ option.value }}'
{% endif %}
{% endfor %}
{% endif %}

0 comments on commit 6e3350a

Please sign in to comment.