Olipro / Project-Illuminati

Welcome to the New World Order
http://olipro.github.io/Project-Illuminati/
GNU Affero General Public License v3.0
12 stars 3 forks source link

`write': wrong argument type Hash (expected String) (TypeError) #2

Open lelutin opened 7 years ago

lelutin commented 7 years ago

Hello,

I'm trying out a simple config that has only one ssh host:

switches:
  repo_path: "/home/vagrant/switches"                       #the path to the repo (absolute path recommended)
  git_author:                                 #the author to specify for git commits and annotated tags
    email: "something@example.com"
    name: "something"
  revfmt: 'r%d'                               #sprintf format to use for tags - this example produces SVN style tags
  defuser: 'someuser'                             #default username for SSH if none is specified for a particular host
  defdirkey: 'hostname'                       #default YAML key to use for each host's config dir
  ssh_keys:                                   #array of SSH keys to attempt authentication with (must be OpenSSH format)
    - '/home/vagrant/.ssh/id_rsa'            #POSIX style

  hosts:                                      #array of hosts we want to fetch data for
    -
      hostname: '10.10.10.200'
      dir: 'someswitch'
      ssh:
        running-config:
          cmd: 'sh run'
        crypto-authentication:
          cmd: 'sh authen'

I'm running this against an HP switch that has public-key auth setup for the manager access.

I get this error:

vagrant@jessie:~/Project-Illuminati$ bundle exec ruby nwo.rb -f p2.yml -n switches
10.10.10.200 - premature channel close
/home/vagrant/Project-Illuminati/lib/rugged-illuminati/commit.rb:74:in `write': wrong argument type Hash (expected String) (TypeError)
    from /home/vagrant/Project-Illuminati/lib/rugged-illuminati/commit.rb:74:in `add_blob'
    from /home/vagrant/Project-Illuminati/lib/rugged-illuminati/commit.rb:80:in `block (2 levels) in add_files'

I've tried with a newly initialized git repos, no repos and a repository with an initial commit with a dummy file. I walways get the same error.

lelutin commented 7 years ago

if I change the ssh section of the host to look like this:

        running-config: 'sh run'
        crypto-authentication: 'sh authen'

then I don't get the error anymore but I'm still getting a "premature channel close" without any explanation. I'm wondering if that's because the switch expects the user to press enter before typing any command.

edit: sorry, was missing the config snippet

Olipro commented 7 years ago

Hi, sorry for the super-late response, are you still having this issue? did you figure it out or give up?

lelutin commented 7 years ago

hi there!

I actually gave up. I was having too many issues with project illuminati, and I ended up realising that RANCID actually now supports git-backed storage, which was what I was looking for combined with router/switch config fetching.