Skip to content

Commit

Permalink
Dump userli_extra_reserved_names to file to avoid "Filename to long" …
Browse files Browse the repository at this point in the history
…error (#56)
  • Loading branch information
t2d authored Nov 4, 2023
1 parent 245e127 commit 8d7ea84
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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
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 %}

0 comments on commit 8d7ea84

Please sign in to comment.