Bug 271329 - net-mgmt/netdisco: Install instructions in pkg-message broken
Summary: net-mgmt/netdisco: Install instructions in pkg-message broken
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-09 11:21 UTC by Einar Bjarni Halldórsson
Modified: 2023-06-02 06:53 UTC (History)
2 users (show)

See Also:
dgeo: maintainer-feedback+
dgeo: maintainer-feedback+


Attachments
git diff UIDs net-mgmt/netdisco: fix and update (21.79 KB, patch)
2023-05-09 12:28 UTC, geoffroy desvernay
dgeo: maintainer-approval+
Details | Diff
git diff UIDs net-mgmt/netdisco: fix and update (22.00 KB, patch)
2023-05-10 06:58 UTC, geoffroy desvernay
dgeo: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Einar Bjarni Halldórsson 2023-05-09 11:21:13 UTC
The install instructions in pkg-message state:

> to get Netdisco running, you just have to:
>  * edit /usr/local/etc/netdisco/environments/deployment.yml to suit your needs
>    (perldoc App::Netdisco::Manual::Configuration)

$ perldoc App::Netdisco::Manual::Configuration
No documentation found for "App::Netdisco::Manual::Configuration"

>  * edit rc.conf according to /usr/local/etc/rc.d/netdisco
>  * read "perldoc App::Netdisco::Manual::Deployment"

$ perldoc App::Netdisco::Manual::Deployment
No documentation found for "App::Netdisco::Manual::Deployment".

>  * place env NETDISCO_HOME=/usr/local/etc/netdisco

Place it where?

>  * launch netdisco-deploy *as user netdisco* to install/upgrade your database

$ sudo -u netdisco netdisco-deploy
Sorry, can't find libs required for App::Netdisco.
BEGIN failed--compilation aborted at /usr/local/bin/netdisco-deploy line 25.

>  * copy (or link) /usr/local/etc/netdisco/netdiscologs.conf
>    to /usr/local/etc/newsyslog.conf.d/ to take care
>    of logs rotation

> Always use "su - netdisco" before running netdisco-do or netdisco-deploy
>  (because of locallib use)

$ sudo su - netdisco
su: no directory
Comment 1 geoffroy desvernay 2023-05-09 11:51:08 UTC
You are right, I did no rewiew this file since a long time.

New pkg-message should better read:

to get Netdisco running, you just have to:
 * edit /usr/local/etc/netdisco/environments/deployment.yml to suit your needs
   (https://github.com/netdisco/netdisco/wiki/Configuration)
 * edit rc.conf according to /usr/local/etc/rc.d/netdisco
 * have a look at https://metacpan.org/pod/App::Netdisco
   note that ~/environments is replaced here by /usr/local/etc/netdisco/environments
 * make variable NETDISCO_HOME=/usr/local/etc/netdisco available for user netdisco
     echo "export NETDISCO_HOME=/usr/local/etc/netdisco" >> ~netdisco/.profile
     chown netdisco ~netdisco/.profile
 * launch netdisco-deploy *as user netdisco* to install/upgrade your database
     su - netdisco -c "netdisco-deploy"
 * copy (or link) /usr/local/etc/netdisco/netdiscologs.conf
   to /usr/local/etc/newsyslog.conf.d/ to take care
   of logs rotation
    ln -s /usr/local/etc/netdisco/netdiscologs.conf /usr/local/etc/newsyslog.conf.d/netdiscologs.conf

Always use "su - netdisco" or "sudo -l -u netdisco" before running any netdisco-do or netdisco-* command
 (because of locallib use)
Comment 2 geoffroy desvernay 2023-05-09 12:17:24 UTC
Currently working on a patch to fix these… This time I think I get it running more easily:
netdisco user still missed a HOME dir and a shell… I corrected in UIDs, placing HOME in /usr/local/etc/netdisco (this avoid need of NETDISCO_HOME variable)

you can make it effective for you running:
  pw user mod -s /bin/sh -d /usr/local/etc/netdisco -u netdisco

After that, "sudo -l -u netdisco" on "su - netdisco" should do the work

The docs have been replaced by wiki pages, I updated this.
Comment 3 geoffroy desvernay 2023-05-09 12:28:12 UTC
Created attachment 242078 [details]
git diff UIDs net-mgmt/netdisco: fix and update

fix pkg-message
update to 2.061001

New features:
  - ACLs portctl_no and portctl_only for limiting port control targets
  - Config setting portctl_nowaps to prevent port control on WAP ports
  - Feature to gather SNMP Walk, use as Pseudo Device, and Browse Objects
  - Added SSHCollector::Platform::ASAContext
  - new addpseudodevice worker action
  - option to display vlan names instead of numbers in device ports
  - renumber device option in the device details web page
  - add option in device ports sidebar to hide vlan 1002-1005
  - Group Cisco subinterfaces in Device Ports view (like LAG)
  - add FortiOS SSH collector implementation from @jpvelders
  - make Port VLAN mismatch respect setting hiding VLAN 1002-1005
  - make VLAN hiding and VLAN names configurable options and move to port properties sidebar section
  - new discover_routed_neighbors setting to skip adding next-hops for discovery
  - new setting macsuck_no_deviceport to ignore nodes on a device port
  - implement ignore_deviceports and hide_deviceports settings
  - implement multi tenancy with tenant_databases setting
  - add worker to collect various PortAccessEntity (NAC) attributes 
  - API Endpoints to submit arpnip and macsuck results
  - custom fields on devices and ports in the web from config
  - sidebar support for custom reports with bind params; add show_sidebar setting
  - support for FQDN node search while domain_suffix is set; add fallback to IPv4 host lookup search
  - implement ignore_layers, force_macsuck, force_arpnip config settings

Many bug fixes and enhancements too, see https://metacpan.org/dist/App-Netdisco/changes for full list
Comment 4 Einar Bjarni Halldórsson 2023-05-09 13:59:39 UTC
Thanks for the very quick repsonse!

I can run it now manually, but I'm attempting to add it to an ansible playbook. That's my problem...

One thing I noticed is that netdisco-deploy requires p5-Crypt-Bcrypt if the admin user doesn't already exist. It should probably be added as a run dependency.
Comment 5 Einar Bjarni Halldórsson 2023-05-09 14:28:47 UTC
(In reply to geoffroy desvernay from comment #2)

Seems it still needs NETDISCO_HOME even with netdisco home set to /usr/local/etc/netdisco
Comment 6 geoffroy desvernay 2023-05-10 06:58:12 UTC
Created attachment 242090 [details]
git diff UIDs net-mgmt/netdisco: fix and update

Added p5-Crypt-Bcrypt dependency and a line about NETDISCO_HOME

If you reinstall with this patch, you'll need to dele netdisco user before, or change it to make his HOME be /usr/local/etc/netdisco and SHELL /bin/sh (at least)
Comment 7 Fernando Apesteguía freebsd_committer freebsd_triage 2023-05-18 14:29:27 UTC
(In reply to geoffroy desvernay from comment #6)
Can you provide detailed instructions to add to UPDATING?
Comment 8 Fernando Apesteguía freebsd_committer freebsd_triage 2023-05-25 12:32:39 UTC
(In reply to Fernando Apesteguía from comment #7)
Ping
Comment 9 Fernando Apesteguía freebsd_committer freebsd_triage 2023-05-31 09:43:58 UTC
(In reply to Fernando Apesteguía from comment #8)
Last ping.
Comment 10 geoffroy desvernay 2023-05-31 15:39:52 UTC
sorry for the delay.

I'd add this:

20230531:
  AFFECTS: users of net-mgmt/netdisco
  AUTHOR: dgeo@centrale-marseille.fr

  The netdisco user now needs a HOME and a shell.
  For existing installs you will need to set
  HOME to /usr/local/etc/netdisco and shell to /bin/sh.

  For example in one shell line:
  pw user mod netdisco -d /usr/local/etc/netdisco -s /bin/sh
Comment 11 Fernando Apesteguía freebsd_committer freebsd_triage 2023-06-01 06:43:00 UTC
(In reply to geoffroy desvernay from comment #10)
Excellent, thanks!
Comment 12 commit-hook freebsd_committer freebsd_triage 2023-06-02 06:53:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d7272b56ac851a1e032199f3043fc7c9e2c4f1a3

commit d7272b56ac851a1e032199f3043fc7c9e2c4f1a3
Author:     geoffroy desvernay <dgeo@centrale-marseille.fr>
AuthorDate: 2023-06-01 06:43:42 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2023-06-02 06:47:11 +0000

    net-mgmt/netdisco: Update to 2.061001

    While here, fix install instructions.

    New features:
     * ACLs portctl_no and portctl_only for limiting port control targets
     * Config setting portctl_nowaps to prevent port control on WAP ports
     * Feature to gather SNMP Walk, use as Pseudo Device, and Browse Objects
     * Added SSHCollector::Platform::ASAContext
     * new addpseudodevice worker action
     * option to display vlan names instead of numbers in device ports
     * renumber device option in the device details web page
     * add option in device ports sidebar to hide vlan 1002-1005
     * Group Cisco subinterfaces in Device Ports view (like LAG)
     * add FortiOS SSH collector implementation from @jpvelders
     * make Port VLAN mismatch respect setting hiding VLAN 1002-1005
     * make VLAN hiding and VLAN names configurable options and move to port
       properties sidebar section
     * new discover_routed_neighbors setting to skip adding next-hops for discovery
     * new setting macsuck_no_deviceport to ignore nodes on a device port
     * implement ignore_deviceports and hide_deviceports settings
     * implement multi tenancy with tenant_databases setting
     * add worker to collect various PortAccessEntity (NAC) attributes
     * API Endpoints to submit arpnip and macsuck results
     * custom fields on devices and ports in the web from config
     * sidebar support for custom reports with bind params; add show_sidebar setting
     * support for FQDN node search while domain_suffix is set; add fallback to
       IPv4 host lookup search
     * implement ignore_layers, force_macsuck, force_arpnip config settings

    Many bug fixes and enhancements too, see https://metacpan.org/dist/App-Netdisco/changes for full list

    PR:             271329
    Reported by:    einar@isnic.is

 UIDs                                   |  2 +-
 UPDATING                               | 11 +++++
 net-mgmt/netdisco/Makefile             |  3 +-
 net-mgmt/netdisco/distinfo             |  6 +--
 net-mgmt/netdisco/files/pkg-message.in | 14 +++---
 net-mgmt/netdisco/pkg-plist            | 82 +++++++++++++++++++++++++++++++++-
 6 files changed, 107 insertions(+), 11 deletions(-)
Comment 13 Fernando Apesteguía freebsd_committer freebsd_triage 2023-06-02 06:53:29 UTC
Committed,

Thanks!