UtrechtUniversity / yoda

A system for reliable, long-term storing and archiving large amounts of research data during all stages of a study.
https://utrechtuniversity.github.io/yoda/
GNU General Public License v3.0
46 stars 27 forks source link

Use yml variable #232

Closed fj-morales closed 1 year ago

fj-morales commented 1 year ago

Use yml variable

stsnel commented 1 year ago

Thanks for the PR! Is the intent of this change that you would like to have the ability to generate the s3auth file in a different location on your servers? In that case, I would suggest adapting the task so that it uses a variable for the s3auth filename, and adding a default value to the role that matches the current hard-coded value. You could then override the default value in your inventory for servers on which you want to use a non-default setting:

The default value would be:

s3_auth_file: /var/lib/irods/.s3auth

And task would be:

- name: Ensure S3 credentials file is present
  ansible.builtin.template:
    src: s3auth.j2
    dest: /var/lib/irods/.s3auth
    dest: "{{ s3_auth_file }}"
    owner: '{{ irods_service_account }}'
    group: irods
    mode: 0600

The new parameter would also need to be added to the documentation at docs/administration/configuring-yoda.md