Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dump userli_extra_reserved_names to file to avoid "Filename to long" #56

Merged
merged 1 commit into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tasks/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,25 @@
changed_when: __userli_reserved_names.rc != 0
failed_when: __userli_reserved_names.rc != 0

- name: Dump custom reservedNames into file
ansible.builtin.template:
src: reserved_names.j2
t2d marked this conversation as resolved.
Show resolved Hide resolved
dest: "{{ userli_home }}/reserved_names"
owner: "{{ userli_user }}"
group: "{{ userli_group }}"
mode: "0660"
when: userli_extra_reserved_names.length > 0

- name: Load custom reservedNames into database
ansible.builtin.command: |
'echo "{{ userli_extra_reserved_names | join("\n") }}" | bin/console app:reservednames:import --file=-'
"bin/console app:reservednames:import --file={{ userli_home }}/reserved_names"
args:
chdir: "{{ userli_symfony_path }}"
environment:
APP_ENV: "prod"
become: true
become_user: "{{ userli_user }}"
when: userli_extra_reserved_names.length > 0
register: __userli_reserved_names
changed_when: __userli_reserved_names.rc != 0
failed_when: __userli_reserved_names.rc != 0
3 changes: 3 additions & 0 deletions templates/reserved_names.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% for name in userli_extra_reserved_names %}
{{ name }}
{% endfor %}