aboutsummaryrefslogtreecommitdiffstats
path: root/molecule/default/converge.yml
diff options
context:
space:
mode:
authorColin Wilk <colin@wilk.cx>2026-06-23 13:21:35 +0200
committerColin Wilk <colin@wilk.cx>2026-06-23 13:21:35 +0200
commit0698339964e9289e9347834c91de25eb3ff8f963 (patch)
tree874c34a420de0ab6e947ebaae87408a80d1fba38 /molecule/default/converge.yml
parentdfeca121000dfc62f4337221ff35a48a4655580e (diff)
downloadansible-role-borgbackup-0698339964e9289e9347834c91de25eb3ff8f963.tar.gz
ansible-role-borgbackup-0698339964e9289e9347834c91de25eb3ff8f963.zip
test: add tests for systemd exist success status
Diffstat (limited to 'molecule/default/converge.yml')
-rw-r--r--molecule/default/converge.yml28
1 files changed, 19 insertions, 9 deletions
diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml
index 7212eb2..995ccd0 100644
--- a/molecule/default/converge.yml
+++ b/molecule/default/converge.yml
@@ -1,11 +1,14 @@
---
- name: Converge
- hosts: borg-client
+ hosts:
+ - borg-client
+ - borg-client-success-exit-status
+ serial: 1
pre_tasks:
- # This would usually be set by the user globally on their ansible
- # repository and can be a security risk to do automatically. We will
- # however set the variable here in the pre_tasks since it is for testing.
+ # This would usually be set by the user globally on their ansible
+ # repository and can be a security risk to do automatically. We will
+ # however set the variable here in the pre_tasks since it is for testing.
- name: Set borg server openssh key variable
become: true
block:
@@ -14,7 +17,7 @@
name: sshd
state: started
become: true
- delegate_to: '{{ borg_server_host }}'
+ delegate_to: "{{ borg_server_host }}"
- name: Fetch ssh_key
ansible.builtin.command: >
@@ -27,14 +30,21 @@
- name: Set ssh_key
ansible.builtin.set_fact:
borg_server_host_ssh_key: '{{ borg_server_ssh_keyscan.stdout
- | split(" ")
- | reject("search", borg_server_host)
- | join(" ") }}'
+ | split(" ")
+ | reject("search", borg_server_host)
+ | join(" ") }}'
+
+ - name: Allow additional successful exit codes on alternate client
+ ansible.builtin.set_fact:
+ borg_backup_service_successful_exit_status:
+ - 1
+ - TEMPFAIL
+ when: inventory_hostname == 'borg-client-success-exit-status'
vars:
borg_server_host: borg-server
borg_server_user_home: /opt/borg
- borg_decryption_keys_yaml_path: '{{ playbook_dir }}/decryption_keys.yml'
+ borg_decryption_keys_yaml_path: "{{ playbook_dir }}/decryption_keys.yml"
borg_included_dirs:
- /etc
- /home