diff --git a/roles/etc-git/tasks/commit.yml b/roles/etc-git/tasks/commit.yml index 94cd02f..d41de38 100644 --- a/roles/etc-git/tasks/commit.yml +++ b/roles/etc-git/tasks/commit.yml @@ -29,17 +29,32 @@ - etc-git - commit-etc -# yamllint disable rule:line-length - name: set commit author set_fact: - commit_author: '{% if ansible_env.SUDO_USER is not defined %}root{% else %}{{ ansible_env.SUDO_USER }}{% endif %}' - commit_email: '{% if git_config_user_email.config_value is not defined or git_config_user_email.config_value == "" %}root@localhost{% else %}{{ git_config_user_email.config_value }}{% endif %}' + commit_author: > + {% if ansible_env.SUDO_USER is not defined %} + root + {% else %} + {{ ansible_env.SUDO_USER }} + {% endif %} + commit_email: > + {% if git_config_user_email.config_value is not defined + or git_config_user_email.config_value == "" %} + root@localhost + {% else %} + {{ git_config_user_email.config_value }} + {% endif %} tags: - etc-git - commit-etc - name: /etc modifications are committed - shell: "git add -A . && git commit -m \"{{ commit_message | mandatory }}\" --author \"{{ commit_author | mandatory }} <{{ commit_email | mandatory }}>\"" + shell: > + git add -A . + && git commit + -m "{{ commit_message | mandatory }}" + --author + "{{ commit_author | mandatory }} <{{ commit_email | mandatory }}>" args: chdir: /etc register: etc_commit_end_run @@ -48,7 +63,6 @@ tags: - etc-git - commit-etc -# yamllint enable rule:line-length - debug: var: etc_commit_end_run