fix some ansible-lint errors

This commit is contained in:
Sergey Malyuk
2025-12-12 18:35:37 +03:00
parent c40b4928f7
commit 3f4556f3b2
7 changed files with 50 additions and 49 deletions

View File

@@ -38,11 +38,11 @@
state: started
roles:
- role: genlab.borgmatic
borg_source_directories:
- role: genlab.common.borgmatic
borgmatic_source_directories:
- "/tmp/data"
borg_repo_path: "ssh://borg@localhost/./test-repo"
borg_repo_label: "test-repo"
borg_encryption_passphrase: "secret"
borgmatic_repo_path: "ssh://borg@localhost/./test-repo"
borgmatic_repo_label: "test-repo"
borgmatic_encryption_passphrase: "secret"
repo_server_inventory_hostname: ubuntu # in production this should be an Ansible inventory hostname
repo_server_user: borg

View File

@@ -11,18 +11,18 @@
- name: "Include default vars"
ansible.builtin.include_vars:
dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/defaults/"
extensions: [ 'yml' ]
extensions: ['yml']
- name: "Check if Borg is installed"
changed_when: false
register: borg_installed_version
register: borgmatic_installed_version
ansible.builtin.command: "/usr/bin/borg --version"
- name: "Check Borg version"
ansible.builtin.assert:
that: borg_installed_version.stdout.find(borg_version)
success_msg: "borg version {{ borg_version }} is installed and working"
fail_msg: "borg version {{ borg_version }} is not installed or not working correctly"
that: borgmatic_installed_version.stdout.find(borgmatic_version)
success_msg: "borg version {{ borgmatic_version }} is installed and working"
fail_msg: "borg version {{ borgmatic_version }} is not installed or not working correctly"
- name: "Check if Borgmatic is installed"
changed_when: false
@@ -31,18 +31,18 @@
cmd: "/usr/bin/borgmatic --version"
- name: "Check that the test repo was created"
register: test_repo_readme
failed_when: test_repo_readme.stat.exists is false
register: borgmatic_test_repo_readme
failed_when: borgmatic_test_repo_readme.stat.exists is false
ansible.builtin.stat:
path: "{{ repo_path }}"
- name: "Check that the systemd timer for Borgmatic is up and running"
register: timer
register: borgmatic_timer
ansible.builtin.systemd:
name: borgmatic.timer
- name: "Assert that the timer is running"
ansible.builtin.assert:
that: timer.status.ActiveState == "active"
that: borgmatic_timer.status.ActiveState == "active"
success_msg: "Timer is running"
fail_msg: "Unexpected timer state: '{{ timer.status.ActiveState }}'"
fail_msg: "Unexpected timer state: '{{ borgmatic_timer.status.ActiveState }}'"