Skip to content

Commit

Permalink
do not hard-code the created username to plone, use the one set in th…
Browse files Browse the repository at this point in the history
…e .env file (#64)

* do not hard-code the created username to plone, use the one set in the .env file

* set default value for the DEPLOY_USER

* use an environment var for the deploy_folder

* adjust for tests

* fix

* fix name

* this is not an ansible template
  • Loading branch information
erral authored Oct 9, 2024
1 parent d6399f4 commit 6bb9207
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion project/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@
"devops/etc",
"devops/playbooks",
"devops/requirements",
"devops/tasks"
"devops/tasks",
"devops/inventory/group_vars/all/users.yml",
"devops/inventory/group_vars/all/projects.yml"

],
"_extensions": [
"cookieplone.filters.use_prerelease_versions",
Expand Down
1 change: 1 addition & 0 deletions project/{{ cookiecutter.__folder_name }}/devops/.env_dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ DEPLOY_ENV=prod
DEPLOY_HOST={{ cookiecutter.hostname }}
DEPLOY_PORT=22
DEPLOY_USER=plone
DEPLOY_FOLDER=/srv/{{ cookiecutter.project_slug }}/data
DOCKER_CONFIG=.docker
STACK_NAME={{ cookiecutter.__devops_stack_name }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project_folders:
# Path to store {{ cookiecutter.hostname }} postgres data
- path: "/srv/{{ cookiecutter.project_slug }}/data"
path: "{{ lookup('ansible.builtin.env', 'DEPLOY_FOLDER', default='/srv/plone/data') }}"
owner: 999
group: 999
mode: "0750"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
users:
default:
name: plone
name: "{{ lookup('ansible.builtin.env', 'DEPLOY_USER', default='plone') }}"
group: sudo
additional_keys: []
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ volumes:
vol-site-data:
driver_opts:
type: none
device: /srv/{{ cookiecutter.project_slug }}/data
device: "${DEPLOY_FOLDER:/srv/{{ cookiecutter.project_slug }}/data}"
o: bind

networks:
Expand Down

0 comments on commit 6bb9207

Please sign in to comment.