Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single play not possible with remote system #5

Open
carygravel opened this issue Apr 10, 2023 · 1 comment
Open

Single play not possible with remote system #5

carygravel opened this issue Apr 10, 2023 · 1 comment

Comments

@carygravel
Copy link

With a remote system, it is not possible to run the first play without error.

  • If you run rsnapshot-remote-host first, it fails because the user has not yet been created by rsnapshot-backup-host.
  • If you run rsnapshot-backup-host first, it fails because the user has not yet been created by rsnapshot-remote-host.

The best you can do is run rsnapshot-backup-host, which creates the user on the host, but errors later fetching the remote user key, then rsnapshot-remote-host, which is then successful, and finally rsnapshot-backup-host again, which is then successful.

However, my play for rsnapshot-remote-host is the trivial:

- hosts: REMOTEHOST
  become: true
  roles:
     - role: yannik.rsnapshot-remote-host
       rsnapshot_backup_host: LOCALHOST

The above could have been created automatically, given the backup_host variable(s) has all the info needed.

Could the two roles not be combined, then it could all be carried out with one play, and without error?

@Yannik
Copy link
Owner

Yannik commented Apr 10, 2023

Interesting question. While I am actively using both roles, I do not set new backup servers very often (mostly new nodes to be backed) up, so I don't think remember experiencing an issue with this.

The foolproof setup method is this:

  1. Run rsnapshot-backup-host on the host pulling the backups, with no rsnapshot_backups configured

then, for each host you want to pull backups from (or all at once)

  1. configure relevant rsnapshot_backups
  2. Run rsnapshot-remote-host on the host you want to pull the backup from
  3. Run rsnapshot-backup-host on the host pulling the backups

However, this rather complicated procedure is not really required (I'm not using it either). Instead, it should be possible to simply run rsnapshot-backup-host (with rsnapshot_backups configured) and then run rsnapshot-remote-host. In this case, you will see an error on the Check that ssh to hosts works task during the rsnapshot-backup-host run, but that is only of informative nature (totally makes sense since you haven't configured the host you are pulling backups frmo yet), and does not lead to failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants