Ansible-lint fixes
Some checks failed
Ansible Lint Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Failing after 44s

This commit is contained in:
2025-09-24 16:28:49 -04:00
parent 728b367d5d
commit b13c47f51e
8 changed files with 25 additions and 25 deletions

View File

@ -16,7 +16,7 @@ readme: README.md
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- Chris Hammer <chhammer@redhat.com>
- Chris Hammer <chhammer@redhat.com>
### OPTIONAL but strongly recommended
@ -26,7 +26,7 @@ description: We do things. To things. For things to happen.
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
license:
- GPL-2.0-or-later
- GPL-2.0-or-later
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
# mutually exclusive with 'license'
@ -34,7 +34,7 @@ license_file: ''
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags: []
tags: ['infra']
# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range

View File

@ -1,7 +1,7 @@
---
- name: Ensure share directory exists
ansible.builtin.file:
path: "{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }}"
path: "{{ rear_vars_nfs_base }}/{{ rear_vars_backup_workflow }}"
state: directory
mode: "0777"
owner: root
@ -11,7 +11,7 @@
- name: Check disk space on ReaR Backup filesystem for NFS servers
ansible.builtin.shell: |
set -o pipefail
df -BG {{ rear_vars_nfs_base }}/{{ rear_backup_workflow }} | tail -1 | awk '{print substr($4, 1, length($4)-1)}'
df -BG {{ rear_vars_nfs_base }}/{{ rear_vars_backup_workflow }} | tail -1 | awk '{print substr($4, 1, length($4)-1)}'
register: disk_space
changed_when: false
@ -30,12 +30,12 @@
ansible.builtin.lineinfile:
path: /etc/exports
state: present
line: "{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }} {{ _options }}"
line: "{{ rear_vars_nfs_base }}/{{ rear_vars_backup_workflow }} {{ _options }}"
create: true
mode: "0644"
owner: root
group: root
loop: "{{ client_ips | list | flatten }}"
vars:
_options: "{{ item }}(fsid={{ rear_vars_nfs_fsid[rear_backup_workflow] }},rw,sync,no_subtree_check,crossmnt)"
_options: "{{ item }}(fsid={{ rear_vars_nfs_fsid[rear_vars_backup_workflow] }},rw,sync,no_subtree_check,crossmnt)"
notify: Export share

View File

@ -1,12 +1,12 @@
---
- name: Create success file directory if not present
ansible.builtin.file:
path: "{{ rear_backup_success_file_path }}"
path: "{{ rear_vars_success_file_path }}"
state: directory
mode: "0755"
- name: Create backup success file
ansible.builtin.copy:
dest: "{{ rear_backup_success_file_path }}/{{ rear_backup_workflow }}_rear_success"
dest: "{{ rear_vars_success_file_path }}/{{ rear_vars_backup_workflow }}_rear_success"
content: "success\n"
mode: "0644"

View File

@ -54,7 +54,7 @@
- name: Create backup of ReaR configuration files
community.general.archive:
path: /etc/rear
dest: /root/etc-rear-backup-{{ rear_backup_workflow }}.tar.gz
dest: /root/etc-rear-backup-{{ rear_vars_backup_workflow }}.tar.gz
format: gz
force_archive: true
mode: "0600"

View File

@ -1,7 +1,7 @@
---
- name: Check for previous backup completion
ansible.builtin.stat:
path: "{{ rear_backup_success_file_path }}/{{ rear_backup_workflow }}_rear_success"
path: "{{ rear_vars_success_file_path }}/{{ rear_vars_backup_workflow }}_rear_success"
register: rear_backup_success_file
- name: End host if backup has already completed successfully

View File

@ -3,9 +3,9 @@
##############################################
OUTPUT=ISO
OUTPUT_URL=nfs://{{ nfs_srv }}{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }}
OUTPUT_URL=nfs://{{ nfs_srv }}{{ rear_vars_nfs_base }}/{{ rear_vars_backup_workflow }}
BACKUP=NETFS
BACKUP_URL=nfs://{{ nfs_srv }}{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }}
BACKUP_URL=nfs://{{ nfs_srv }}{{ rear_vars_nfs_base }}/{{ rear_vars_backup_workflow }}
# SSH_ROOT_PASSWORD="foo"
USE_STATIC_NETWORKING=yes
CLONES_ALL_USERS_GROUPS=yes

View File

@ -4,7 +4,7 @@
paths:
- /var/tmp
patterns:
- "rear_restore.{{ rear_backup_workflow }}*"
- "rear_restore.{{ rear_vars_backup_workflow }}*"
register: rear_restore_file
- name: Check for ReaR restore
@ -21,7 +21,7 @@
- name: Check if /etc/rear backup exists
ansible.builtin.stat:
path: "/root/etc-rear-backup-{{ rear_backup_workflow }}.tar.gz"
path: "/root/etc-rear-backup-{{ rear_vars_backup_workflow }}.tar.gz"
register: rear_config_backup_stat
- name: Restore the server
@ -30,19 +30,19 @@
block:
- name: Create tmpdir
ansible.builtin.file:
path: "{{ rear_restore_tmpdir }}"
path: "{{ rear_vars_tmpdir }}"
state: directory
mode: "0755"
- name: Extract /etc/rear archive contents
ansible.builtin.unarchive:
remote_src: true
src: "/root/etc-rear-backup-{{ rear_backup_workflow }}.tar.gz"
dest: "{{ rear_restore_tmpdir }}"
src: "/root/etc-rear-backup-{{ rear_vars_backup_workflow }}.tar.gz"
dest: "{{ rear_vars_tmpdir }}"
- name: Copy local.cfg from backup into /etc/rear
ansible.builtin.copy:
src: "{{ rear_restore_tmpdir }}/rear/local.conf"
src: "{{ rear_vars_tmpdir }}/rear/local.conf"
dest: /etc/rear/local.conf
remote_src: true
mode: "0600"
@ -71,13 +71,13 @@
path: "{{ item }}"
state: absent
loop:
- "{{ rear_restore_tmpdir }}"
- "{{ rear_vars_tmpdir }}"
- "{{ rear_restore_file['files'] | json_query('[].path') }}"
- "{{ rear_backup_success_file_path }}/{{ rear_backup_workflow }}_rear_success"
- "{{ rear_vars_success_file_path }}/{{ rear_vars_backup_workflow }}_rear_success"
- name: Create file for ReaR restore success
ansible.builtin.file:
path: "/var/tmp/rear_restore.{{ rear_backup_workflow }}.{{ ansible_date_time.iso8601_basic }}"
path: "/var/tmp/rear_restore.{{ rear_vars_backup_workflow }}.{{ ansible_date_time.iso8601_basic }}"
state: touch
mode: "0664"

View File

@ -4,17 +4,17 @@
# - rear_backup
# - rear_local-cfg
# - rear_restore
rear_backup_workflow: standalone
rear_vars_backup_workflow: standalone
# Used by:
# - rear_restore
rear_restore_tmpdir: /var/tmp/rear_restore
rear_vars_tmpdir: /var/tmp/rear_restore
# Used by:
# - rear_backup
rear_backup_success_file_path: "/var/IPE/IPU/el7to8"
rear_vars_success_file_path: "/var/IPE/IPU/el7to8"
rear_vars_grub_label: 'Relax-and-Recover *** RESTORES RHEL7 ***'
rear_vars_grub_conf: /etc/grub.d/45_rear