I'm not expecting simple glib answers to this, just fishing around for ideas and possible approaches.
I have quite a few systems spread around the place all running Debian derived versions of Linux:-
Desktop machine in my study, main work machine, runs xubuntu Laptop, used around the house and when away, runs xubuntu Backup machine, headless, in garage, runs xubuntu Raspberry pi on home LAN for DNS/DHCP etc., runs raspbian Virtual machine on Gandi, runs ubuntu Beaglebone Black on our boat, runs Debian
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls ...
Can anyone suggest a way of doing this? If it was automatic (like syncthing) than that would be lovely, but even a simple way to say 'please update all instances of ~/.dircolors' would be handy.
I'm using syncthing to keep the laptop and desktop machines in sync and it works well but it's not perfect for synchronising just a few files. It also seems a rather heavyweight program to run on the pi and the BBB just to synchronise two or three files.
I don't really need 'instant' synchronisation either (as provided by syncthing), something run by cron once an hour or even once a day would be fine.
I can't just run rsync with a list of files from cron because not all systems (not *any* in fact) have ssh access to other systems without needing a password or key.
FWIW I run Nextcloud on my server (headless, in the shed).
-- PhilOn Wed, 2018-08-01 at 09:07 +0100, Chris Green wrote:
I'm not expecting simple glib answers to this, just fishing around for ideas and possible approaches.
I have quite a few systems spread around the place all running Debian derived versions of Linux:-
Desktop machine in my study, main work machine, runs xubuntu Laptop, used around the house and when away, runs xubuntu Backup machine, headless, in garage, runs xubuntu Raspberry pi on home LAN for DNS/DHCP etc., runs raspbian Virtual machine on Gandi, runs ubuntu Beaglebone Black on our boat, runs Debian
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls ...
Can anyone suggest a way of doing this? If it was automatic (like syncthing) than that would be lovely, but even a simple way to say 'please update all instances of ~/.dircolors' would be handy.
I'm using syncthing to keep the laptop and desktop machines in sync and it works well but it's not perfect for synchronising just a few files. It also seems a rather heavyweight program to run on the pi and the BBB just to synchronise two or three files.
I don't really need 'instant' synchronisation either (as provided by syncthing), something run by cron once an hour or even once a day would be fine.
I can't just run rsync with a list of files from cron because not all systems (not *any* in fact) have ssh access to other systems without needing a password or key.
Can anyone suggest a way of doing this? If it was automatic (like syncthing) than that would be lovely, but even a simple way to say 'please update all instances of ~/.dircolors' would be handy.
How about creating a git repo or repos, pushing updates to github or bitbucket whenever you update the files and running a cron job on each machine to pull updates regularly?
On 1 August 2018 at 12:59, Ewan Slater ewan.slater@gmail.com wrote:
How about creating a git repo or repos, pushing updates to github or bitbucket whenever you update the files and running a cron job on each machine to pull updates regularly?
For the examples given, pulling the latest updates on login might be the best option (eg from .bashrc or similar).
On Wed, Aug 01, 2018 at 01:20:06PM +0100, Mark Rogers wrote:
On 1 August 2018 at 12:59, Ewan Slater ewan.slater@gmail.com wrote:
How about creating a git repo or repos, pushing updates to github or bitbucket whenever you update the files and running a cron job on each machine to pull updates regularly?
For the examples given, pulling the latest updates on login might be the best option (eg from .bashrc or similar).
Yes, certainly from the 'when to do it' point of view that would make sense.
On Wed, Aug 01, 2018 at 12:59:13PM +0100, Ewan Slater wrote:
Can anyone suggest a way of doing this? If it was automatic (like syncthing) than that would be lovely, but even a simple way to say 'please update all instances of ~/.dircolors' would be handy.
How about creating a git repo or repos, pushing updates to github or bitbucket whenever you update the files and running a cron job on each machine to pull updates regularly?
That's an idea, though can you pull from git to a number of rather spread out (as in spread out around the system) files? ... or would you need a separate git repository for each?
That's an idea, though can you pull from git to a number of rather spread out (as in spread out around the system) files? ... or would you need a separate git repository for each?
Quickest way would be to have a single git repo for your home directory, add the files you want explicitly and use a (rather large) .gitignore file to exclude everything else.
Cleanest way is to have a separate repo for each and have your script manage the pulls.
I'd go for the second option myself, mainly because a lot of the subdirectories under home contain git repositories and I'd just confuse myself if I had one in home as well. So the script would add a bit of complexity, but for me that would be worth it. YMMV.
You'd probably want to script the initial clone to speed the process for multiple machines.
I'd go for the second option myself, mainly because a lot of the subdirectories under home contain git repositories and I'd just confuse myself if I had one in home as well. So the script would add a bit of complexity, but for me that would be worth it. YMMV.
To be clear I meant: "a lot of subdirectories under home *on* *my* *machine* contain git repositories"
On 01/08/2018 09:07, Chris Green wrote:
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls
On my main machine I've made a directory ~/cfg that holds my tinkered with files. I've set up a git repo (on a 4GB USB stuck in the wifi-router) On whatever other machine I just git clone and then run ~/cfg/linkup.sh which is:
ln -s ~/cfg/aliases ~/.aliases ln -s ~/cfg/bash_logout ~/.bash_logout ln -s ~/cfg/bash_profile ~/.bash_profile ln -s ~/cfg/bashrc ~/.bashrc ln -s ~/cfg/colours ~/.colours ln -s ~/cfg/environ ~/.environ ln -s ~/cfg/gitconfig ~/.gitconfig ... and lots of other similar gubbins.
git push/pull as I make changes / can be bothered.
On Wed, Aug 01, 2018 at 03:17:23PM +0100, Bill Hill wrote:
On 01/08/2018 09:07, Chris Green wrote:
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls
On my main machine I've made a directory ~/cfg that holds my tinkered with files. I've set up a git repo (on a 4GB USB stuck in the wifi-router) On whatever other machine I just git clone and then run ~/cfg/linkup.sh which is:
ln -s ~/cfg/aliases ~/.aliases ln -s ~/cfg/bash_logout ~/.bash_logout ln -s ~/cfg/bash_profile ~/.bash_profile ln -s ~/cfg/bashrc ~/.bashrc ln -s ~/cfg/colours ~/.colours ln -s ~/cfg/environ ~/.environ ln -s ~/cfg/gitconfig ~/.gitconfig ... and lots of other similar gubbins.
git push/pull as I make changes / can be bothered.
Yes, I do something similar from a folder synchronised by syncthing, I guess that's about as good as I'm going to get.
On Wed, 1 Aug 2018 at 16:40, Chris Green cl@isbd.net wrote:
On Wed, Aug 01, 2018 at 03:17:23PM +0100, Bill Hill wrote:
On 01/08/2018 09:07, Chris Green wrote:
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls
Yes, I do something similar from a folder synchronised by syncthing, I guess that's about as good as I'm going to get.
--
Read up on Puppet - you can run it as a master on your main computer and have it push files, update requests etc. to the others.
Jenny
On 04/08/18 09:16, Jenny Hopkins wrote:
On Wed, 1 Aug 2018 at 16:40, Chris Green cl@isbd.net wrote:
On Wed, Aug 01, 2018 at 03:17:23PM +0100, Bill Hill wrote:
On 01/08/2018 09:07, Chris Green wrote:
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls
Yes, I do something similar from a folder synchronised by syncthing, I guess that's about as good as I'm going to get.
--
Read up on Puppet - you can run it as a master on your main computer and have it push files, update requests etc. to the others.
I much, much prefer Ansible to either Puppet or Chef, but Chris has already said that he doesn't have password-less SSH on all the machines, so I didn't bother suggesting it.
It would do what he wants though, if he had.
Cheers, Laurie.
On Sat, Aug 04, 2018 at 09:16:42AM +0100, Jenny Hopkins wrote:
On Wed, 1 Aug 2018 at 16:40, Chris Green cl@isbd.net wrote:
On Wed, Aug 01, 2018 at 03:17:23PM +0100, Bill Hill wrote:
On 01/08/2018 09:07, Chris Green wrote:
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls
Yes, I do something similar from a folder synchronised by syncthing, I guess that's about as good as I'm going to get.
--
Read up on Puppet - you can run it as a master on your main computer and have it push files, update requests etc. to the others.
Coo, what a load of 'corporate speak', I've yet to find out what it actually does!
... I've found the open-source installtion instructions now, somewhat better. However it does seem that the 'cure' would take more effort than the 'disease' in my case if I used Puppet.
On 04/08/18 10:07, Chris Green wrote:
On Sat, Aug 04, 2018 at 09:16:42AM +0100, Jenny Hopkins wrote:
On Wed, 1 Aug 2018 at 16:40, Chris Green cl@isbd.net wrote:
On Wed, Aug 01, 2018 at 03:17:23PM +0100, Bill Hill wrote:
On 01/08/2018 09:07, Chris Green wrote:
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls
Yes, I do something similar from a folder synchronised by syncthing, I guess that's about as good as I'm going to get.
--
Read up on Puppet - you can run it as a master on your main computer and have it push files, update requests etc. to the others.
Coo, what a load of 'corporate speak', I've yet to find out what it actually does!
... I've found the open-source installtion instructions now, somewhat better. However it does seem that the 'cure' would take more effort than the 'disease' in my case if I used Puppet.
Chris, Puppet (or Chef) would be a gross over-kill for what you want to do. Ansible would do it (via cron or manually) as it pushes instructions over SSH (it has no agents on the remote machines), but it does require password-less SSH to work.
There are a number of free tutorials out there, including from RedHat (who now "own" Ansible).
Cheers, Laurie.
On Sat, Aug 04, 2018 at 10:26:13AM +0100, Laurie Brown wrote:
On 04/08/18 10:07, Chris Green wrote:
On Sat, Aug 04, 2018 at 09:16:42AM +0100, Jenny Hopkins wrote:
On Wed, 1 Aug 2018 at 16:40, Chris Green cl@isbd.net wrote:
On Wed, Aug 01, 2018 at 03:17:23PM +0100, Bill Hill wrote:
On 01/08/2018 09:07, Chris Green wrote:
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls
Yes, I do something similar from a folder synchronised by syncthing, I guess that's about as good as I'm going to get.
--
Read up on Puppet - you can run it as a master on your main computer and have it push files, update requests etc. to the others.
Coo, what a load of 'corporate speak', I've yet to find out what it actually does!
... I've found the open-source installtion instructions now, somewhat better. However it does seem that the 'cure' would take more effort than the 'disease' in my case if I used Puppet.
Chris, Puppet (or Chef) would be a gross over-kill for what you want to do.
Yes, that was the conclusion I came to on looking at Puppet.
Ansible would do it (via cron or manually) as it pushes instructions
over SSH (it has no agents on the remote machines), but it does require password-less SSH to work.
There are a number of free tutorials out there, including from RedHat (who now "own" Ansible).
I'll take a look at Ansible, thanks. Outgoing password-less ssh from one machine that's well locked down isn't a *huge* risk. As it is I have ssh keyphrase outgoing from my main machine which uses my login password as the key-phrase so it's effectively passwordless as I tend the leave the machine on (with me logged in) all the time. :-)
On 04/08/18 10:57, Chris Green wrote:
On Sat, Aug 04, 2018 at 10:26:13AM +0100, Laurie Brown wrote:
On 04/08/18 10:07, Chris Green wrote:
On Sat, Aug 04, 2018 at 09:16:42AM +0100, Jenny Hopkins wrote:
On Wed, 1 Aug 2018 at 16:40, Chris Green cl@isbd.net wrote:
On Wed, Aug 01, 2018 at 03:17:23PM +0100, Bill Hill wrote:
On 01/08/2018 09:07, Chris Green wrote:
> I have several bits of customised configuration that I would like to, > somehow, keep in sync on all the above machines, these are things like:- > > ~/.vilerc - editor configuration > ~/.dircolors - colours for ls
Yes, I do something similar from a folder synchronised by syncthing, I guess that's about as good as I'm going to get.
--
Read up on Puppet - you can run it as a master on your main computer and have it push files, update requests etc. to the others.
Coo, what a load of 'corporate speak', I've yet to find out what it actually does!
... I've found the open-source installtion instructions now, somewhat better. However it does seem that the 'cure' would take more effort than the 'disease' in my case if I used Puppet.
Chris, Puppet (or Chef) would be a gross over-kill for what you want to do.
Yes, that was the conclusion I came to on looking at Puppet.
Ansible would do it (via cron or manually) as it pushes instructions
over SSH (it has no agents on the remote machines), but it does require password-less SSH to work.
There are a number of free tutorials out there, including from RedHat (who now "own" Ansible).
I'll take a look at Ansible, thanks. Outgoing password-less ssh from one machine that's well locked down isn't a *huge* risk. As it is I have ssh keyphrase outgoing from my main machine which uses my login password as the key-phrase so it's effectively passwordless as I tend the leave the machine on (with me logged in) all the time. :-)
The account that runs Ansible commands for you (simply put, it's a clever wrapper that sends shell commands via SSH to remote machines) doesn't need to have any special privileges beyond the ability to connect to the remote machine.
Once connected, one can then structure the command to assume root privileges temporarily if required on the remote machine. Ansible has both a CLI interface, and scripts, which are (essentially) known as playbooks. My guess is that you would use the CLI option.
There's a learning curve! but it's simple enough once you get your head around it.
https://www.digitalocean.com/community/tutorials/how-to-install-and-configur...
There are tons of tutorials out there, this one seems quite good, if a bit of a skim over:
https://blacksaildivision.com/ansible-tutorial-part-1
Cheers, Laurie.
I know some answers on here have already mentioned git... I am just further agreeing with this answer.
If I was in your position (files I want to be shared on multiple servers) - I would create a git repository containing those files. With git, there is a master branch which (I would) represent as my current file base. However, I would also create a _live_ branch or similar. So, when I merge my changes into this branch, my servers would automatically execute a script, placing those files in their appropriate location.
I do this with website development. Once I merge my new changes to the _live_ branch, my website is updated automatically.
Of course to do this would require some git knowledge, as well as, for each server, knowing how to execute the script when the _live_ branch is updated.
On Wed, Aug 1, 2018 at 9:07 AM, Chris Green cl@isbd.net wrote:
I'm not expecting simple glib answers to this, just fishing around for ideas and possible approaches.
I have quite a few systems spread around the place all running Debian derived versions of Linux:-
Desktop machine in my study, main work machine, runs xubuntu Laptop, used around the house and when away, runs xubuntu Backup machine, headless, in garage, runs xubuntu Raspberry pi on home LAN for DNS/DHCP etc., runs raspbian Virtual machine on Gandi, runs ubuntu Beaglebone Black on our boat, runs Debian
I have several bits of customised configuration that I would like to, somehow, keep in sync on all the above machines, these are things like:-
~/.vilerc - editor configuration ~/.dircolors - colours for ls ...
Can anyone suggest a way of doing this? If it was automatic (like syncthing) than that would be lovely, but even a simple way to say 'please update all instances of ~/.dircolors' would be handy.
I'm using syncthing to keep the laptop and desktop machines in sync and it works well but it's not perfect for synchronising just a few files. It also seems a rather heavyweight program to run on the pi and the BBB just to synchronise two or three files.
I don't really need 'instant' synchronisation either (as provided by syncthing), something run by cron once an hour or even once a day would be fine.
I can't just run rsync with a list of files from cron because not all systems (not *any* in fact) have ssh access to other systems without needing a password or key.
-- Chris Green
main@lists.alug.org.uk http://www.alug.org.uk/ https://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!