Skip to content

Commit

Permalink
Make linter happier
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Apr 18, 2024
1 parent b20640d commit 31b6553
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Populating can be done with a Ansible playbook (this could be run during workspa
```shell
sudo -i
git clone -b grader-samba https://github.com/eWaterCycle/infra.git /opt/infra
ansible-playbook /opt/infra/playbooks/shared-data-disk.yml
ansible-playbook /opt/infra/shared-data-disk.yml
```

This will:
Expand Down
5 changes: 3 additions & 2 deletions roles/prep_shared_data/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: Download climate data
include_tasks: climate-data.yml
# TODO Make smaller selection
# - name: Download climate data
# include_tasks: climate-data.yml
- name: ESMValTool aux data
include_tasks: esmvaltool-aux-data.yml
- name: Build apptainer image files (sif) for each model
Expand Down
46 changes: 24 additions & 22 deletions shared-data-disk.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
- name: Download data from internet and upload to dcache
- name: Download data from internet to file server
hosts:
- localhost
- all
vars:
# Creds from https://cds.climate.copernicus.eu Climate Data Store
cds_uid: null # Must be filled from other place
Expand All @@ -12,41 +11,44 @@
climate_end_year: 1990
# dCache token for uploading files
dcache_rw_token: null # Must be filled from command line
data_root: /data/volume_2/samba-share
tasks:
# any sram user can become root via passwordless sudo
# TODO exclude students from becoming root
- name: Harden share
file:
ansible.builtin.file:
path: '/data/volume_2/samba-share/'
state: directory
mode: 0755
mode: 'u=rwx,g=rx,o=rx'

- name: Read-only share
lineinfile:
ansible.builtin.lineinfile:
path: /etc/samba/smb.conf
line: "read only = yes"
regexp: "^\s+read only ="
line: 'read only = yes'
regexp: '^\s+read only ='
insertafter: '[samba-share]'
notify: restart samba
notify: Restart samba

# Apptainer is need to build apptainer images from Docker
- name: apptainer
include_role:
- name: Apptainer
ansible.builtin.include_role:
name: apptainer

- name: Prepare shared data
include_role:
name: prep_shared_data
ansible.builtin.include_role:
name: prep_shared_data

- name: Download observation data
include_role:
name: grdc
ansible.builtin.include_role:
name: grdc

- name: Install rclone
include_role:
name: rclone
tasks_from: install
ansible.builtin.include_role:
name: rclone
tasks_from: install

handlers:
- name: restart samba
service:
name: smbd
state: restarted
handlers:
- name: Restart samba
ansible.builtin.service:
name: smbd
state: restarted

0 comments on commit 31b6553

Please sign in to comment.