fix: report concatenation commands as unchanged

The `awk 1` commands assembling the chain, fullchain and all files declared
`changed_when: chain_content.rc == 0`, which holds on every successful run. As a
result the role never reported a converged state, even when no certificate was
touched.

These commands only read files and write to stdout, so mark them as unchanged.
The subsequent copy task remains responsible for reporting an actual change.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-09-07 22:30:23 +02:00
co-authored by Copilot
parent a6e647b842
commit 2cd88df81b
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -58,7 +58,7 @@
ansible.builtin.command: ansible.builtin.command:
cmd: awk 1 {{ _chain_files | join(' ') }} cmd: awk 1 {{ _chain_files | join(' ') }}
register: chain_content register: chain_content
changed_when: chain_content.rc == 0 changed_when: false
when: _stat_result.stat.exists is defined and when: _stat_result.stat.exists is defined and
_stat_result.stat.exists _stat_result.stat.exists
- name: Create concatenated chain file - name: Create concatenated chain file
@@ -85,7 +85,7 @@
ansible.builtin.command: ansible.builtin.command:
cmd: awk 1 {{ _chain_files | join(' ') }} cmd: awk 1 {{ _chain_files | join(' ') }}
register: chain_content register: chain_content
changed_when: chain_content.rc == 0 changed_when: false
when: _stat_result.stat.exists is defined and when: _stat_result.stat.exists is defined and
_stat_result.stat.exists _stat_result.stat.exists
- name: Create concatenated fullchain file - name: Create concatenated fullchain file
@@ -112,7 +112,7 @@
ansible.builtin.command: ansible.builtin.command:
cmd: awk 1 {{ _chain_files | join(' ') }} cmd: awk 1 {{ _chain_files | join(' ') }}
register: chain_content register: chain_content
changed_when: chain_content.rc == 0 changed_when: false
when: _stat_result.stat.exists is defined and when: _stat_result.stat.exists is defined and
_stat_result.stat.exists _stat_result.stat.exists
- name: Create concatenated file - name: Create concatenated file
@@ -58,7 +58,7 @@
ansible.builtin.command: ansible.builtin.command:
cmd: awk 1 {{ _chain_files | join(' ') }} cmd: awk 1 {{ _chain_files | join(' ') }}
register: chain_content register: chain_content
changed_when: chain_content.rc == 0 changed_when: false
when: _stat_result.stat.exists is defined and when: _stat_result.stat.exists is defined and
_stat_result.stat.exists _stat_result.stat.exists
- name: Create concatenated chain file - name: Create concatenated chain file
@@ -85,7 +85,7 @@
ansible.builtin.command: ansible.builtin.command:
cmd: awk 1 {{ _chain_files | join(' ') }} cmd: awk 1 {{ _chain_files | join(' ') }}
register: chain_content register: chain_content
changed_when: chain_content.rc == 0 changed_when: false
when: _stat_result.stat.exists is defined and when: _stat_result.stat.exists is defined and
_stat_result.stat.exists _stat_result.stat.exists
- name: Create concatenated fullchain file - name: Create concatenated fullchain file
@@ -112,7 +112,7 @@
ansible.builtin.command: ansible.builtin.command:
cmd: awk 1 {{ _chain_files | join(' ') }} cmd: awk 1 {{ _chain_files | join(' ') }}
register: chain_content register: chain_content
changed_when: chain_content.rc == 0 changed_when: false
when: _stat_result.stat.exists is defined and when: _stat_result.stat.exists is defined and
_stat_result.stat.exists _stat_result.stat.exists
- name: Create concatenated file - name: Create concatenated file
+1 -1
View File
@@ -51,7 +51,7 @@
ansible.builtin.command: ansible.builtin.command:
cmd: awk 1 {{ _chain_files | join(' ') }} cmd: awk 1 {{ _chain_files | join(' ') }}
register: chain_content register: chain_content
changed_when: chain_content.rc == 0 changed_when: false
when: _stat_result.stat.exists is defined and when: _stat_result.stat.exists is defined and
_stat_result.stat.exists _stat_result.stat.exists
- name: Create concatenated file - name: Create concatenated file