From c810423b30bbbeee0befcec5b5939bf332fbf78b Mon Sep 17 00:00:00 2001 From: Frank Dornheim <524257+conloos@users.noreply.github.com> Date: Sat, 11 Mar 2023 14:05:11 +0100 Subject: [PATCH] Removed install_backup as var (bool) to prevent that this role run --- README.md | 1 - meta/arguments_specs.yml | 4 ---- tasks/01_install.yml | 1 - tasks/02_user_management.yml | 4 +--- tasks/03_create_key.yml | 2 -- tasks/05_configure.yml | 2 -- tasks/06_init_borg_repo.yml | 1 - tasks/07_install_timer.yml | 2 -- tasks/noauto_create_backup_user_and_group.yml | 1 - tasks/noauto_create_cronjobs.yml | 3 --- tasks/noauto_create_timer.yml | 1 - 11 files changed, 1 insertion(+), 21 deletions(-) diff --git a/README.md b/README.md index 7d925ec..9bf8985 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,6 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl ### Optional Arguments -- `install_backup`: If the varialbe (bool) is set to false the installation of the rolle is skipped. - `borg_dep_packages`: Dependancy Packages to install `borg(backup)` and `borgmatic`. - `borg_distro_packages`: contains the names of distributions packages for `borg(backup)` and `borgmatic`, only used if `borg_install_method` is set to `package`. - `borg_encryption_passcommand`: The standard output of this command is used to unlock the encryption key. diff --git a/meta/arguments_specs.yml b/meta/arguments_specs.yml index b742f3f..f7ade74 100644 --- a/meta/arguments_specs.yml +++ b/meta/arguments_specs.yml @@ -181,7 +181,3 @@ argument_specs: type: str required: false description: If the variable is set, a timer is installed. A choice must be made between "cron" and "systemd". - install_backup: - type: bool - required: false - description: If the varialbe is set to false the installation of the rolle is skipped. diff --git a/tasks/01_install.yml b/tasks/01_install.yml index 3ea9dd2..bfa2088 100644 --- a/tasks/01_install.yml +++ b/tasks/01_install.yml @@ -1,6 +1,5 @@ --- - name: Install borgbackup - when: install_backup is not defined or install_backup tags: - install_backup block: diff --git a/tasks/02_user_management.yml b/tasks/02_user_management.yml index 3dc059c..936f1c3 100644 --- a/tasks/02_user_management.yml +++ b/tasks/02_user_management.yml @@ -4,7 +4,6 @@ - name: Get home dir when: - borgbackup_user == "root" - - install_backup is not defined or install_backup tags: - install_backup block: @@ -22,8 +21,7 @@ - name: Create User if borgbackup_user != "root" when: - - borgbackup_user == "root" - - install_backup is not defined or install_backup + - borgbackup_user != "root" tags: - install_backup ansible.builtin.include_tasks: diff --git a/tasks/03_create_key.yml b/tasks/03_create_key.yml index 2077550..4d0959e 100644 --- a/tasks/03_create_key.yml +++ b/tasks/03_create_key.yml @@ -1,7 +1,6 @@ --- - name: Create ssh-key (if neeeded) for {{ borgbackup_user }} when: - - install_backup is not defined or install_backup - backup_id_rsa is not defined or backup_id_rsa | length == 0 tags: - install_backup @@ -45,7 +44,6 @@ - name: Install ssh cert and key for user when: - - install_backup is not defined or install_backup - backup_id_rsa is defined and backup_id_rsa | length > 0 - backup_id_rsa_pub is defined and backup_id_rsa_pub | length > 0 tags: diff --git a/tasks/05_configure.yml b/tasks/05_configure.yml index f81d0b7..a99c0ed 100755 --- a/tasks/05_configure.yml +++ b/tasks/05_configure.yml @@ -1,7 +1,5 @@ --- - name: Configure borgbackup - when: - - install_backup is not defined or install_backup tags: - install_backup block: diff --git a/tasks/06_init_borg_repo.yml b/tasks/06_init_borg_repo.yml index 957c632..2d45dd0 100644 --- a/tasks/06_init_borg_repo.yml +++ b/tasks/06_init_borg_repo.yml @@ -1,7 +1,6 @@ --- - name: Init repository when: - - install_backup is not defined or install_backup - borgmatic_initialization_repo is defined and borgmatic_initialization_repo tags: - install_backup diff --git a/tasks/07_install_timer.yml b/tasks/07_install_timer.yml index 0684832..c8cccee 100644 --- a/tasks/07_install_timer.yml +++ b/tasks/07_install_timer.yml @@ -1,7 +1,6 @@ --- - name: Create borgbackup timer when: - - install_backup is not defined or install_backup - borgmatic_timer is defined and borgmatic_timer == "systemd" tags: - install_backup @@ -12,7 +11,6 @@ - name: Create borgbackup cron when: - - install_backup is not defined or install_backup - borgmatic_timer is defined or borgmatic_timer == "cron" tags: - install_backup diff --git a/tasks/noauto_create_backup_user_and_group.yml b/tasks/noauto_create_backup_user_and_group.yml index 9d04036..fc3a339 100644 --- a/tasks/noauto_create_backup_user_and_group.yml +++ b/tasks/noauto_create_backup_user_and_group.yml @@ -3,7 +3,6 @@ tags: - install_backup when: - - install_backup is not defined or install_backup - backup_create_local_user is not defined or backup_create_local_user - borgbackup_user != "root" block: diff --git a/tasks/noauto_create_cronjobs.yml b/tasks/noauto_create_cronjobs.yml index 6345717..ca1a298 100644 --- a/tasks/noauto_create_cronjobs.yml +++ b/tasks/noauto_create_cronjobs.yml @@ -1,7 +1,6 @@ --- - name: Add cron-job for borgmatic (large repo, create and check separate) when: - - install_backup is not defined or install_backup - borgmatic_timer is defined and borgmatic_timer == "cron" - borgmatic_large_repo tags: @@ -36,7 +35,6 @@ - name: Add cron-job for borgmatic (normal-sized repo) when: - - install_backup is not defined or install_backup - borgmatic_timer is defined and borgmatic_timer == "cron" - not borgmatic_large_repo tags: @@ -58,7 +56,6 @@ - name: Set PATH for borgmatic cron job. when: - - install_backup is not defined or install_backup - borgmatic_timer is defined and borgmatic_timer == "cron" tags: - install_backup diff --git a/tasks/noauto_create_timer.yml b/tasks/noauto_create_timer.yml index ed64a9e..233be15 100644 --- a/tasks/noauto_create_timer.yml +++ b/tasks/noauto_create_timer.yml @@ -1,7 +1,6 @@ --- - name: Create borgbackup timer when: - - install_backup is not defined or install_backup - borgmatic_timer is defined and borgmatic_timer == "systemd" tags: - install_backup