Hook push_to_remote failed ArgumentError: wrong number of arguments
I have a working version of oxidized on RHEL. I wanted to push to a gitlab account for offsite backup. No matter what I do I get the following error.
I, [2021-05-25T22:23:30.558718 #173078] INFO -- : GithubRepo: Pushing local repository(/home/oxidized/.config/oxidized/oxidized.git/)... I, [2021-05-25T22:23:30.559352 #173078] INFO -- : GithubRepo: to remote: [email protected]:xxxx/xxxx/oxidized.git E, [2021-05-25T22:23:30.559669 #173078] ERROR -- : Hook push_to_remote (#GithubRepo:0x0000000002108680) failed (#<ArgumentError: wrong number of arguments (given 2, expected 0..1)>) for event :post_store
hooks: push_to_remote: type: githubrepo events: [post_store] remote_repo: [email protected]:xxxx/xxxx/oxidized.git publickey: /home/oxidized/.ssh/id_rsa.pub privatekey: /home/oxidized/.ssh/id_rsa
See this maybe this helps.
Where you able to figure this out. I am having a similar issue.
Sorry no,
I just gave up. I was going to try and use a docker image but time is not on my side. If you manage to find a solution please let me know I would love to get this into gitlab.
On Thu, Sep 15, 2022 at 8:53 AM allenderj @.***> wrote:
Where you able to figure this out. I am having a similar issue.
— Reply to this email directly, view it on GitHub https://github.com/ytti/oxidized/issues/2309#issuecomment-1248292906, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHPG2V3ZYNXMET44Y7PCNLV6NBAHANCNFSM45QKYWUQ . You are receiving this because you authored the thread.Message ID: @.***>
I did find a work around. I am now using a file output then I just git init the directory with the files manually added a the gitlab repo as a remote and then changed my hook to an exec type that runs a shell script to add, commit and push the repo.
#!/bin/bash
#Change to repo directory
cd /home/oxidized/network_backups_test
#Track any new files
git add -A
#Commit
git commit -m "Commited by Oxidized"
#Push the repo
git push
You just have to set up the repo and the user running oxidized manually.
output:
default: file
file:
directory: /home/oxidized/network_backups_test/
hooks:
push_to_remote:
type: exec
events: [nodes_done]
cmd: "cd /home/oxidized && ./push.sh"
I would like to use the correct output and hook but this is working fine it seems.