scaleway / netbox-netprod-importer

Poll data from network devices in production and import it into netbox
GNU General Public License v3.0
101 stars 31 forks source link

Add inventory - import + interconnect and set password for napalm #17

Closed VictorPavlushin closed 5 years ago

VictorPavlushin commented 5 years ago

1) Add inventory - import + interconnect 2) Add arg - Password

VictorPavlushin commented 5 years ago

Could not understand how to make cherry pick, made a new patch. Went to read the book on git.

aruhier commented 5 years ago

Hi @VictorPavlushin, Thanks again for your PR. As I said earlier, I don't get why you added another option for the password, neither why you added an inventory option.

VictorPavlushin commented 5 years ago

Hi! I added the inventory function in order not to run twice, first import and then interconnect. because port-channels can be added and deleted. As the connected devices. To be able to pass the password as a parameter, and not to ask online.

aruhier commented 5 years ago

Hmm, maybe it should be better to allow to use an environment variable to store the password instead. I'm personaly not a big fan of writing the password directly in the CLI.

We can keep the inventory function if you want to. I personally don't really think it's necessary if we allow to set the password either on the CLI or in en environment variable, as you can script the 2 commands without any user interaction needed.

VictorPavlushin commented 5 years ago

Hmm, maybe it should be better to allow to use an environment variable to store the password instead. I'm personaly not a big fan of writing the password directly in the CLI.

Here, in principle, no difference, but it is not transparent. If this is the way to do it, you can do it this way: echo "PASS" | netbox-netprod-importer imp -u user -p file.yml. This doesn’t affect the security, as the user should have only the "show *" option in the user. I think it is necessary to leave and add another option to the configuration file (default password) as well as the user name. And also add user and password options to the Device list for each device. Since Devices can be divided between departments and they are not always in contact with each other.

We can keep the inventory function if you want to. I personally don't really think it's necessary if we allow to set the password either on the CLI or in en environment variable, as you can script the 2 commands without any user interaction needed.

It is more convenient for use through cron.

VictorPavlushin commented 5 years ago

So how about putting login and password in the configuration files?