Navigation Menu

Skip to content

Commit

Permalink
extract config style (ini or yml) from galaxy_config_file as suggeste…
Browse files Browse the repository at this point in the history
…d by nuwang
  • Loading branch information
drosofff committed Jan 14, 2019
1 parent 9af2a88 commit 8954929
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions defaults/main.yml
Expand Up @@ -66,10 +66,7 @@ galaxy_server_dir: /mnt/galaxy/galaxy-app
galaxy_venv_dir: "{{ galaxy_server_dir }}/.venv"

# A system path for Galaxy's main configuration file
# Galaxy config file can either be 'ini-paste' (old style) or 'yaml'
galaxy_config_style: "ini-paste"
galaxy_config_file_basename: "galaxy.{{ 'yml' if galaxy_config_style in ('yaml', 'yml') else 'ini' }}"
galaxy_config_file: "{{ galaxy_server_dir }}/config/{{ galaxy_config_file_basename }}"
galaxy_config_file: "{{ galaxy_server_dir }}/config/galaxy.ini"

## Set this to 'yes' if you are targeting galaxy in a docker container
galaxy_runs_in_docker: no
Expand Down
4 changes: 2 additions & 2 deletions tasks/bootstrap_user.yml
Expand Up @@ -25,13 +25,13 @@

- name: Set bootstrap user as Galaxy Admin with config file in ini-paste style
lineinfile: dest={{ galaxy_config_file }} state=present insertafter="app:main" regexp="^[ ]*admin_users[ ]*=[ ]*" line="admin_users = {{ galaxy_tools_admin_user }}" #"
when: (create_user is defined) and create_user and (admin_users_found.msg == "") and (galaxy_config_style == "ini-paste")
when: (create_user is defined) and create_user and (admin_users_found.msg == "") and ('.ini' in {{ galaxy_config_file }})
notify:
- ansible-galaxy-tools restart galaxy

- name: Set bootstrap user as Galaxy Admin with config file in yaml style
lineinfile: dest={{ galaxy_config_file }} state=present regexp='^([ ]*)admin_users[ ]*{{ ":" }}.*' line=' admin_users{{ ":" }} {{ galaxy_tools_admin_user }}'
when: (create_user is defined) and create_user and (admin_users_found.msg == "") and (galaxy_config_style == "yaml" or galaxy_config_style == "yml")
when: (create_user is defined) and create_user and (admin_users_found.msg == "") and ('.yml' in {{ galaxy_config_file }})
notify:
- ansible-galaxy-tools restart galaxy

Expand Down

0 comments on commit 8954929

Please sign in to comment.