ITADN

template file directly instead of copying template

#220Closedsleepy-nols 创建于 2025-03-12
S
sleepy-nolscommented
hi all, this role is great, but I have run into some weird problems when trying configurations out manually and then deploying ansible ontop of this. So my question here is, why is the configuration being templated and then copied to real config instead of just running lineinfile on the actual config file? ```diff \- name: Write the paperless-ngx config file become: true ansible.builtin.lineinfile: - path: "{{ paperless_ngx_config_file_template }}" + path: "{{ paperless_ngx_config_file }}" regexp: ^#?{{ item.pngx_var }}= line: "{{ item.pngx_var }}={{ item.role_var }}" + owner: root + group: root + mode: "0644" loop: # already alphabetical sorted - pngx_var: PAPERLESS_ACCOUNT_ALLOW_SIGNUPS role_var: "{{ paperless_ngx_conf_account_allow_signups }}" since_version: '2.5.0' ... no_log: "{{ not item.log | default(omit) }}" when: - item.role_var is defined and item.role_var not in (None, omit) - item.condition | default(true) - (item.since_version | default('0.0.1')) is ansible.builtin.version(paperless_ngx_version, '<=', version_type='semver') tags: pngx_conf + notify: Restart paperless completely - \- name: Deploy paperless-ngx configuration file - become: true - ansible.builtin.copy: - src: "{{ paperless_ngx_config_file_template }}" - remote_src: true - dest: "{{ paperless_ngx_config_file }}" - tags: pngx_conf - notify: Restart paperless completely ```
关闭于 2025-05-02 2 条评论