Feature #9657

Improve puppet apply to support network device

Added by Nan Liu 8 months ago. Updated 8 months ago.

Status:Needs Decision Start date:09/23/2011
Priority:Normal Due date:
Assignee:Randall Hansen % Done:

0%

Category:-
Target version:2.7.x
Affected Puppet version:2.7.3 Branch:
Keywords:network, device
Votes: 1

Description

After writing additional network device, it seems reasonable to support device in puppet apply. Currently network resources are skipped:

debug: /Stage[main]//F5_virtualserver[www-http]: Skipping device resources because running on a host
debug: /Stage[main]//F5_virtualserver[www-https]: Skipping device resources because running on a host

Rather than having two separate modules with slight differences (see: https://github.com/puppetlabs/puppetlabs-f5/issues/42). It makes sense to ensure puppet resource and puppet apply also supports —deviceconfig option.

History

Updated by Randall Hansen 8 months ago

(From email): Want to avoid the puppet apply —apply or:

use_cached_catalog = false
usecacheonfailure = true

I’m thinking about adding puppet apply —allow_device:

This is most commonly used with: puppet apply —allow_device —deviceconfig


Randall says:

I’m not sure exactly what this option would do. What would you pass to it? How do those config flags relate to the option?

Updated by Nigel Kersten 8 months ago

  • Status changed from Unreviewed to Needs More Information
  • Assignee set to Nan Liu

Updated by Nigel Kersten 8 months ago

Randall, Nan and I had a chat about this, and here' s the result of the brain dump.

How the world is:

puppet device is a command line tool that behaves like ‘agent’ in that it connects to a master, gets the catalog for each device specified in ‘deviceconfig’ (default: /etc/puppet/device.conf) and applies it to the devices, but proxied through the agent that the puppet device command is running on.

The deviceconfig file can contain definitions for more than one device, and is restricted to per-device configuraitons (e.g. no defaults, inheritance, etc)

The problem is that we have no facility for quick testing without a master by applying a single manifest.

puppet apply mydevicerules.pp

This currently fails to apply because apply is designed to apply resources to the current node, not to a remote node.

We don’t think that we want to automatically have manifests be able to be applied to remote devices as it would violate the principle of least surprise, where applying a single manifest to a host would result in resources being applied to remote resources.

Possible proposals:

mydevicerules.pp – A manifest containing at least one resource/rule to be applied to a device.

puppet apply --device=mydevice mydevicerules.pp This would apply the resources to a device called mydevice and whose definition is found in device.conf

puppet apply --deviceconfig=/path/to/mydeviceconfig.conf mydevicerules.pp This could apply the manifest to multiple devices?

puppet apply --device=mydevice mixed_local_and_device_resources.pp There has been some talk about allowing mixed manifests where some kinds of resources would be applied to the remote device, and others to the local node. This seems incoherent…

Updated by Nigel Kersten 8 months ago

  • Status changed from Needs More Information to Needs Decision
  • Assignee changed from Nan Liu to Randall Hansen

Randall, the open questions are:

  • Should we support devices at all in puppet apply?
    • Or should we flip it around and allow puppet device to operate in a mode like apply rather than agent? (perhaps by simply having a manifest as the last argument)
    • Or should we make a new Face called device-apply ?
  • Should we enable automatic application of resources to remote devices without explicitly saying so when using puppet apply?
  • If we don’t want automatic application, how should we name the options to allow application of resources to remote devices?

Updated by Nan Liu 8 months ago

puppet apply --device=mydevice mydevicerules.pp This would apply the resources to a device called mydevice and whose definition is found in device.conf

puppet apply --deviceconfig=/path/to/mydeviceconfig.conf mydevicerules.pp This could apply the manifest to multiple devices?

puppet apply --device=mydevice mixed_local_and_device_resources.pp There has been some talk about allowing mixed manifests where some kinds of resources would be applied to the remote device, and others to the local node. This seems incoherent…

In all examples we need some option to invert apply behavior so it applies resources that are apply_to_device/apply_to_all, and skip apply_to_host. This is why the original ticket proposed the option --allow_device, I don’t know if there’s a better name for this flag.

Also available in: Atom PDF