Skip to content

Commit

Permalink
role fact_workspace_info: add fact fact_workspace_storage
Browse files Browse the repository at this point in the history
  • Loading branch information
dometto committed Jan 6, 2025
1 parent 33e9eb6 commit 748fb14
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/roles/fact_workspace_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
## Summary
Makes information about the workspace and CO available as Ansible facts. Provides three facts:

- `fact_workspace_info` -- dict object containing info about the workspace (CO, user endpoint URL, etc.)/
- `fact_desktop_workspace` -- Boolean, true if the workspace has a desktop environment.
- `fact_workspace_info` -- Dict. Object containing info about the workspace (CO, user endpoint URL, etc.)/
- `fact_desktop_workspace` -- Boolean. True if the workspace has a desktop environment.
- `fact_workspace_storage` -- List. List of Strings of paths to ResearchCloud storage volumes mounted on the workspace.

## Requires
Linux flavor operating system.
Expand All @@ -30,6 +31,12 @@ See here for example output of the facts.
}
```

`fact_workspace_storage`:

```json
"fact_workspace_storage": ["/data/my_storage_volume"]
```

## History
2024 Written by Dawa Ometto (Utrecht University)

Expand Down
10 changes: 10 additions & 0 deletions playbooks/roles/fact_workspace_info/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
- min
when: ansible_os_family is not defined

- name: Gather mounts facts
setup:
gather_subset:
- mounts
when: ansible_mounts is not defined

- name: Set fact_workspace_storage
ansible.builtin.set_fact:
fact_workspace_storage: "{{ ansible_mounts | selectattr('mount', 'search', '^/data/') | list }}"

- name: Get all packages as facts
package_facts:
manager: auto
Expand Down

0 comments on commit 748fb14

Please sign in to comment.