I’m trying to configure motd for my servers based on their hostnames. I would
like to put output of figlet #{node[:hostname]} in to /etc/motd. I would
also like to have a figlet program installed only on chef server. Is there any
way that chef server can “compute” figlet and then use it as a variable to the
client?
As far as I know all recipes, attributes and templates are ran on client side
The Chef server goes to great trouble to not run any outside code,
for security and stability reasons. So you'll need a hack-ier
solution, I'm afraid.
If you're running chef-client on your chef server, you can probably
use a combination of searching and file specificity[1] to generate the
results of the commands as remote files. Then you'd just use a remote
file resource to install them on each host.
Of course, if there's some way you can do this as a template instead,
that'd be much easier.
I'm trying to configure motd for my servers based on their hostnames. I would
like to put output of figlet #{node[:hostname]} in to /etc/motd. I would
also like to have a figlet program installed only on chef server. Is there any
way that chef server can "compute" figlet and then use it as a variable to the
client?
As far as I know all recipes, attributes and templates are ran on client side