目前使用oxidized 0.30.1
當要將備份 push 到 公司內部 gitlab , 透過ssh key
手動能夠正常push ,
但在oxidized hook 自動push 時, 就會出現以下訊息
狀況與以下連結相同
https://github.com/ytti/oxidized/issues/1038
https://github.com/ytti/oxidized/issues/2217
也已安裝libssh2-devel 也試過將 git@gitlab.xxxx 改為ssh//:git@gitlab.xxxx
似乎都無效 , 改為帳密驗證也是一樣狀況, 但還沒試過改為http 的方式
請問大家是否有解決方式? 謝謝
May 31 13:05:20 oxidized.example.com.tw oxidized[3581802]: I, [2024-05-31T13:05:20.277722 #3581802] INFO -- : Oxidized starting, running as pid 3581802
May 31 13:05:20 oxidized.example.com.tw oxidized[3581802]: I, [2024-05-31T13:05:20.630508 #3581802] INFO -- : lib/oxidized/nodes.rb: Loading nodes
May 31 13:05:21 oxidized.example.com.tw oxidized[3581802]: I, [2024-05-31T13:05:21.744969 #3581802] INFO -- : lib/oxidized/nodes.rb: Loaded 143 nodes
May 31 13:05:23 oxidized.example.com.tw oxidized[3581802]: Puma starting in single mode...
May 31 13:05:23 oxidized.example.com.tw oxidized[3581802]: * Version 3.11.4 (ruby 3.0.0-p0), codename: Love Song
May 31 13:05:23 oxidized.example.com.tw oxidized[3581802]: * Min threads: 0, max threads: 16
May 31 13:05:23 oxidized.example.com.tw oxidized[3581802]: * Environment: development
May 31 13:05:23 oxidized.example.com.tw oxidized[3581802]: * Listening on tcp://127.0.0.1:8888
May 31 13:05:23 oxidized.example.com.tw oxidized[3581802]: Use Ctrl-C to stop
May 31 13:08:05 oxidized.example.com.tw oxidized[3581802]: I, [2024-05-31T13:08:05.079906 #3581802] INFO -- : Configuration updated for defaultgrp/10.2.230.218
May 31 13:08:05 oxidized.example.com.tw oxidized[3581802]: I, [2024-05-31T13:08:05.080587 #3581802] INFO -- : GithubRepo: Pushing local repository(/opt/oxidized/configbackup/defaultgrp.git/)...
May 31 13:08:05 oxidized.example.com.tw oxidized[3581802]: I, [2024-05-31T13:08:05.080644 #3581802] INFO -- : GithubRepo: to remote: ssh://git@gitlab.example.com.tw:oxidized/oxidized_backup.git
May 31 13:08:05 oxidized.example.com.tw oxidized[3581802]: E, [2024-05-31T13:08:05.358623 #3581802] ERROR -- : Hook push_to_remote (#<GithubRepo:0x0000000001d530a8>) failed (#<Rugged::NetworkError: unsupported URL protocol>) for event :post_store
hooks 設定如下
hooks:
push_to_remote:
type: githubrepo
events: [post_store]
remote_repo: git@gitlab.example.com.tw:oxidized/oxidized_backup.git
publickey: /opt/oxidized/.ssh/id_oxidized.pub
privatekey: /opt/oxidized/.ssh/id_oxidized
更新
懶得找hooks 問題了, 改用script 排程自動同步, 隨然沒有那麼即時, 但效果幾乎是一樣的, 也算是解決問題了