alan-turing-institute / data-safe-haven

https://data-safe-haven.readthedocs.io
BSD 3-Clause "New" or "Revised" License
61 stars 15 forks source link

Ansible: create icons directory #2121

Closed jemrobinson closed 3 months ago

jemrobinson commented 3 months ago

:white_check_mark: Checklist

:vertical_traffic_light: Depends on

n/a

:arrow_heading_up: Summary

IMPORTANT: I am confident that merging this will not affect the findings of the ongoing penetration test

Create missing /usr/local/share/icons directory in Ansible

:closed_umbrella: Related issues

n/a

:microscope: Tests

Tested on running SRE

github-actions[bot] commented 3 months ago

Coverage report

This PR does not seem to contain any modification to coverable code.

craddm commented 3 months ago

Did you check if

    - name: Copy icons
      ansible.builtin.copy:
        src: "usr/local/share/icons/{{ item }}"
        dest: /usr/local/share/icons/
        mode: '0444'
      loop:
        - gitea.png
        - hedgedoc.png

worked?

Either is way fine I think.

If you mean whether that alone worked with no further changes, that was failing on my VM until I manually created /urs/local/share/icons/

jemrobinson commented 3 months ago

This seems to work

If dest is a non-existent path and if either dest ends with “/” or src is a directory, dest is created.

I'll update the YAML and try again.

jemrobinson commented 3 months ago

@JimMadge : I've simplified a few ansible.builtin.copy tasks to copy everything in src to dest. Unless there's any reason not to do this, I think it's cleaner and minimises the possibility of forgetting to copy a file.

jemrobinson commented 3 months ago

@craddm : I think the trailing / is the thing that triggers whether or not the directory is created.