Easiest would be to clone your repo to a local folder, and then point your oxidized config to that local folder. All the commits etc will be automated. You don’t have to worry about initial commits etc.
ok. that’s what I was hoping and expecting. Unfortunately that means I have a more involved misunderstanding.
Just for a clean slate, I deleted /home/oxidized/devices.git. Upon restarting oxidized (I’m doing it manually until everything is working) it creates the devices.git (yay!):
[oxidized@librenms01 ~]$ cd devices.git/
[oxidized@librenms01 devices.git]$ ls
config description HEAD hooks index info objects refs
[oxidized@librenms01 devices.git]$ ls -la
total 20
drwxrwxr-x. 6 oxidized oxidized 116 Mar 11 08:23 .
drwx------. 7 oxidized oxidized 4096 Mar 11 09:05 ..
-rw-rw-r--. 1 oxidized oxidized 122 Mar 11 08:22 config
-rw-rw-r--. 1 oxidized oxidized 73 Mar 11 08:22 description
-rw-rw-r--. 1 oxidized oxidized 23 Mar 11 08:22 HEAD
drwxrwxr-x. 2 oxidized oxidized 27 Mar 11 08:22 hooks
-rw-rw-r--. 1 oxidized oxidized 225 Mar 11 08:23 index
drwxrwxr-x. 2 oxidized oxidized 21 Mar 11 08:22 info
drwxrwxr-x. 10 oxidized oxidized 90 Mar 11 08:23 objects
drwxrwxr-x. 4 oxidized oxidized 31 Mar 11 08:22 refs
oxidized runs. according to the logs it fetches the cisco configs (only doing two for right now). But they aren’t showing up in the devices.git
and I also get the dreaded:
[oxidized@librenms01 devices.git]$ git status
fatal: This operation must be run in a work tree
oxidized.log:
[oxidized@librenms01 ~]$ grep git oxidized.log
D, [2021-03-10T15:34:28.475826 #27838] DEBUG -- : node.rb: resolving node key
'output', with passed global value of 'git' and node value ''
D, [2021-03-10T15:34:28.475946 #27838] DEBUG -- : node.rb: returning node key
'output' with value 'git'
D, [2021-03-10T15:34:28.507443 #27838] DEBUG -- : node.rb: resolving node key
'output', with passed global value of 'git' and node value ''
D, [2021-03-10T15:34:28.507487 #27838] DEBUG -- : node.rb: returning node key
'output' with value 'git'
<truncated>
ah, ok. I think I see it now. The ‘ciscos.git’ (for example) is not the git repo itself. ciscos.git has the info but it actually has to be pushed to an upstream ‘real’ repo (in my case I’m using a local gitlab). Once in the gitlab project -then- I can see the configs.
If you have them in git repo, it will not be blatantly obvious where they are, because they are stored in objects. You would need something like git ls-files (if I remember correctly) to show you the files. So let it pull the files, then issue that command and see what happens.
A local git repo is still a repo. So it will contain files like HEAD, refs etc. As I said, use git ls-files in the root of the directory to see all the files contained within the directory.
Good morning, I need to integrate git with oxidized to collect the backups to the repository, but I don’t know what steps to take, can someone explain to me step by step how to do the integration?