Move static files into files/ and Jinja2 templates into templates/ #169
No reviewers
Labels
No labels
Blocked
Existing Service
Infrastructure Issue
Refactor
Security Hardening
Security Issue
Service Idea
Service Removal
Upgrade service
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: data.coop/ansible#169
Loading…
Reference in a new issue
No description provided.
Delete branch "move_stuff_around"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I've moved files around so that they are in the correct folders, and so that it makes more sense (to me at least :D).
This is how it looks now:
What do you think?
@ -20,2 +19,3 @@
- name: Run byro
docker_compose:
project_name: "byro member system"
project_name: byro_member_system"
will this not break the deployment by creating a new stack with a new name?
It will, so we will need to take down the old containers first. However, I think it's better to have a
project_name
without spaces, as the containers are actually namedbyromembersystem_...
if spaces are in the name. Naming with underscores better reflects what the container names will be.if you want to do the work it's fine by me - I can live with the non-underscore name ;)
I can't XD
I'll do the work, no problem!
@ -4,3 +4,2 @@
copy:
src: "files/configs/docker_registry/nginx.conf"
dest: "/docker-volumes/nginx/vhost/{{ services.docker_registry.domain }}"
src: vhost/docker
can we call this file docker_registry?
My (undocumented) naming convention here is actually the subdomain the service is hosted on, so the docker registry's domain is
docker.data.coop
and the vhost file isdocker
(without.data.coop
). But if you insist I can change it.can we have the full domain name as the name of the file then? the same with the other comments
Then I would rather use the service name instead, just for the sake of avoiding code duplication (not hardcoding the base domain). What do you think?
ah yes very good point! let's use the name of the service and not anything related to the domain name
@ -23,2 +23,2 @@
template:
src: files/configs/mastodon/vhost-mastodon
copy:
src: vhost/social
can we call this file mastodon ?
@ -4,2 +4,2 @@
template:
src: files/configs/nextcloud/vhost
copy:
src: vhost/cloud
can we call this file nextcloud ?
f6061e1b5e
to7d13fc5302
@samsapti what's the reason that there are subfolders for each service in
files/
but not intemplates/
?(I like the idea of consistently having subfolders for each service, it scales better and the pattern is easier to enforce when it's simple to understand)
Ansible doesn't support it when it comes to referencing the files from a task. If you have subfolders in
templates/
, you need to reference it astemplates/path/to/file.j2
instead ofpath/to/file.j2
in atemplate
task. This is not the case withfiles/
in thecopy
task, subfolders work without thefiles/
prefix in file paths.(I haven't actually verified this myself, that's just what I've seen online.)
I just tested:
with the template in
docker/templates/testdir/test.j2
works as expected :)So, I also think we should namespace templates. @samsapti when that is done you have an approve from me :)