Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

--auto-discover option needs better documentation #1499

Closed
@ghost

Description

SNAPTELD documentation page lacks proper explanation of --auto-discover option. The option description is "Auto discover paths separated by colons", but doesn't say anything about the purpose.
There is a single example below with "snapteld --auto-discover /opt/snap/plugins/" line suggesting this option might be used to automatically load plugins, but that's all.

In the SNAPTELD_CONFIGURATION page at the end there is a comment on restarting snapteld process and it says that not only plugins in the auto_discover_path will be reloaded, but also tasks! (which wasn't mentioned anywhere else).

And there is the TASKS page which doesn't say anything about auto-discovery and auto-loading tasks at all.

I guess that auto-loading tasks feature was added later and documentation wasn't properly updated...
Anyway, I suggest adding an explanation of --auto-discover option on the SNAPTELD page with additional examples (with comments) showing clearly it migt be also used for auto-loading tasks.

Additionally, the TASKS page should also be updated with the proper information regarding auto-loading tasks.

Activity

nanliu

nanliu commented on Jan 31, 2017

@nanliu
Contributor

Yeah this isn't documented very well. We should change the default config to use two directories: one for tasks, the other for plugins:

# Control sections for configuration settings for the plugin
# control module of snapteld.
control:
  # auto_discover_path sets a directory to auto load plugins and tasks on the start
  # of the snap daemon
  auto_discover_path: /opt/snap/plugins:/opt/snap/tasks
nanliu

nanliu commented on Feb 1, 2017

@nanliu
Contributor

We also could use some community contributions deploying Snap with configuration management tools. I feel like this would avoid having everyone reinvent/rediscover good defaults/best practices.

For example, this could be one way take advantage of this setting to load tasks/plugins (with purging support of obsolete tasks/plugins) in Puppet:

define snap::plugins(
  $version,
) {
  $url = "https://github.com/intelsdi-x/${name}/releases/download/${version}/${name}_linux_x86_64"
  archive { "/opt/snap/plugins/${name}":
    mode   => '0755',
    source => $url,
    notify => Service['snap-telemetry'],
  }
}

define snap::task(
  $settings,
) {
  file { "/opt/snap/tasks/${name}.yml":
    content => inline_template("@settings.to_yaml"),
    notify  => Service['snap-telemetry'],
  }
}
file { ['/opt/snap/plugins', '/opt/snap/tasks']:
  ensure => directory,
  purge  => true,
}

snap::plugin { 'snap-plugin-publisher-influxdb':
  version => 20,
}

snap::plugin { 'snap-plugin-collector-psutil':
  version => 9,
}
jcooklin

jcooklin commented on Feb 1, 2017

@jcooklin
Collaborator

When the documentation is updated in regards to the auto load path it should mention that plugins will need to have the proper permissions (including execute bit set).

Relates to: #1501

added 2 commits that reference this issue on Feb 7, 2017

Fix intelsdi-x#1499 update explaination to auto-discovery plugin.

09b1980

Fix intelsdi-x#1499 update explaination to auto-discovery plugin.

d037dc0
added a commit that references this issue on Feb 9, 2017

Merge pull request #1510 from nanliu/autodis

a429f3e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      --auto-discover option needs better documentation · Issue #1499 · intelsdi-x/snap