Ansible-lint fixes
Some checks failed
Ansible Lint Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Failing after 44s
Some checks failed
Ansible Lint Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Failing after 44s
This commit is contained in:
@ -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)
|
# 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'
|
# @nicks:irc/im.site#channel'
|
||||||
authors:
|
authors:
|
||||||
- Chris Hammer <chhammer@redhat.com>
|
- Chris Hammer <chhammer@redhat.com>
|
||||||
|
|
||||||
|
|
||||||
### OPTIONAL but strongly recommended
|
### 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
|
# 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'
|
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
|
||||||
license:
|
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
|
# 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'
|
# 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
|
# 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'
|
# 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
|
# 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
|
# collection label 'namespace.name'. The value is a version range
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure share directory exists
|
- name: Ensure share directory exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }}"
|
path: "{{ rear_vars_nfs_base }}/{{ rear_vars_backup_workflow }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0777"
|
mode: "0777"
|
||||||
owner: root
|
owner: root
|
||||||
@ -11,7 +11,7 @@
|
|||||||
- name: Check disk space on ReaR Backup filesystem for NFS servers
|
- name: Check disk space on ReaR Backup filesystem for NFS servers
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
set -o pipefail
|
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
|
register: disk_space
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
@ -30,12 +30,12 @@
|
|||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/exports
|
path: /etc/exports
|
||||||
state: present
|
state: present
|
||||||
line: "{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }} {{ _options }}"
|
line: "{{ rear_vars_nfs_base }}/{{ rear_vars_backup_workflow }} {{ _options }}"
|
||||||
create: true
|
create: true
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
loop: "{{ client_ips | list | flatten }}"
|
loop: "{{ client_ips | list | flatten }}"
|
||||||
vars:
|
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
|
notify: Export share
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
- name: Create success file directory if not present
|
- name: Create success file directory if not present
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ rear_backup_success_file_path }}"
|
path: "{{ rear_vars_success_file_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Create backup success file
|
- name: Create backup success file
|
||||||
ansible.builtin.copy:
|
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"
|
content: "success\n"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
- name: Create backup of ReaR configuration files
|
- name: Create backup of ReaR configuration files
|
||||||
community.general.archive:
|
community.general.archive:
|
||||||
path: /etc/rear
|
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
|
format: gz
|
||||||
force_archive: true
|
force_archive: true
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Check for previous backup completion
|
- name: Check for previous backup completion
|
||||||
ansible.builtin.stat:
|
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
|
register: rear_backup_success_file
|
||||||
|
|
||||||
- name: End host if backup has already completed successfully
|
- name: End host if backup has already completed successfully
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
OUTPUT=ISO
|
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=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"
|
# SSH_ROOT_PASSWORD="foo"
|
||||||
USE_STATIC_NETWORKING=yes
|
USE_STATIC_NETWORKING=yes
|
||||||
CLONES_ALL_USERS_GROUPS=yes
|
CLONES_ALL_USERS_GROUPS=yes
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
paths:
|
paths:
|
||||||
- /var/tmp
|
- /var/tmp
|
||||||
patterns:
|
patterns:
|
||||||
- "rear_restore.{{ rear_backup_workflow }}*"
|
- "rear_restore.{{ rear_vars_backup_workflow }}*"
|
||||||
register: rear_restore_file
|
register: rear_restore_file
|
||||||
|
|
||||||
- name: Check for ReaR restore
|
- name: Check for ReaR restore
|
||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
- name: Check if /etc/rear backup exists
|
- name: Check if /etc/rear backup exists
|
||||||
ansible.builtin.stat:
|
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
|
register: rear_config_backup_stat
|
||||||
|
|
||||||
- name: Restore the server
|
- name: Restore the server
|
||||||
@ -30,19 +30,19 @@
|
|||||||
block:
|
block:
|
||||||
- name: Create tmpdir
|
- name: Create tmpdir
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ rear_restore_tmpdir }}"
|
path: "{{ rear_vars_tmpdir }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Extract /etc/rear archive contents
|
- name: Extract /etc/rear archive contents
|
||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
remote_src: true
|
remote_src: true
|
||||||
src: "/root/etc-rear-backup-{{ rear_backup_workflow }}.tar.gz"
|
src: "/root/etc-rear-backup-{{ rear_vars_backup_workflow }}.tar.gz"
|
||||||
dest: "{{ rear_restore_tmpdir }}"
|
dest: "{{ rear_vars_tmpdir }}"
|
||||||
|
|
||||||
- name: Copy local.cfg from backup into /etc/rear
|
- name: Copy local.cfg from backup into /etc/rear
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ rear_restore_tmpdir }}/rear/local.conf"
|
src: "{{ rear_vars_tmpdir }}/rear/local.conf"
|
||||||
dest: /etc/rear/local.conf
|
dest: /etc/rear/local.conf
|
||||||
remote_src: true
|
remote_src: true
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
@ -71,13 +71,13 @@
|
|||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop:
|
loop:
|
||||||
- "{{ rear_restore_tmpdir }}"
|
- "{{ rear_vars_tmpdir }}"
|
||||||
- "{{ rear_restore_file['files'] | json_query('[].path') }}"
|
- "{{ 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
|
- name: Create file for ReaR restore success
|
||||||
ansible.builtin.file:
|
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
|
state: touch
|
||||||
mode: "0664"
|
mode: "0664"
|
||||||
|
|
||||||
|
@ -4,17 +4,17 @@
|
|||||||
# - rear_backup
|
# - rear_backup
|
||||||
# - rear_local-cfg
|
# - rear_local-cfg
|
||||||
# - rear_restore
|
# - rear_restore
|
||||||
rear_backup_workflow: standalone
|
rear_vars_backup_workflow: standalone
|
||||||
|
|
||||||
|
|
||||||
# Used by:
|
# Used by:
|
||||||
# - rear_restore
|
# - rear_restore
|
||||||
rear_restore_tmpdir: /var/tmp/rear_restore
|
rear_vars_tmpdir: /var/tmp/rear_restore
|
||||||
|
|
||||||
|
|
||||||
# Used by:
|
# Used by:
|
||||||
# - rear_backup
|
# - 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_label: 'Relax-and-Recover *** RESTORES RHEL7 ***'
|
||||||
rear_vars_grub_conf: /etc/grub.d/45_rear
|
rear_vars_grub_conf: /etc/grub.d/45_rear
|
||||||
|
Reference in New Issue
Block a user