f5devcentral / f5-puppet

Puppet modules for F5 BIG-IP
Apache License 2.0
13 stars 27 forks source link

Changed the f5_command module implementation, to execute native tmsh or bash commands #17

Closed ericzji closed 7 years ago

ericzji commented 7 years ago

For the original design, to execute a TMSH command, you have to: 1) specify an absolute URI, such as /mgmt/tm/cm/device 2) along with JSON body { "command":"mv", "name":"bigip1", "target":"selfdevice2", } both of above are different for different TMSH commands.

The new way of implementation is to simplify, by providing a way to execute native tmsh or bash commands using the REST API (/mgmt/tm/util/bash). All the user has to provide is the exact TMSH or bash command.

Here is an example: (for the same purpose of above: to rename the self device) f5_command { '/Common/tmsh': tmsh => "tmsh mv cm device bigip1 bigip-a.f5.local", }

It's tested, with document updated.

alexjfisher commented 7 years ago

How is this idempotent?? If I use this resource, the command will be executed every 30 minutes? The example

f5_command { '/Common/tmsh':
  tmsh => "tmsh mv cm device bigip1 bigip-a.f5.local",
}

will work on the first run and then fail on all subsequent runs.