Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a resource for managing the motd #9717

Open
2 tasks
tas50 opened this issue Apr 22, 2020 · 4 comments
Open
2 tasks

Add a resource for managing the motd #9717

tas50 opened this issue Apr 22, 2020 · 4 comments
Labels
Focus: Resources Triage: Feature Request Indicates an issue requesting new functionality.

Comments

@tas50
Copy link
Contributor

tas50 commented Apr 22, 2020

Core Chef Resource Checklist

Before suggesting a resource for inclusion please make sure your suggestion meets these criteria for resources built into Chef:

  • Automates an operating system component that ships by default on systems such as authentication, raid, disk partitions, firewalls, containers, or virtualization systems.
  • Does not attempt automate 3rd party applications such as database, web, or application servers, which are best suited for cookbooks due to their fast moving nature.

Describe the resource:

A resource that would allow you to set the content of the system's MTOD

Why should this be included out of the box?:

A lot of organizations want to set a security warning here and we should make that super simple.

What operating systems would it run on?

Linux at least

@tas50 tas50 added Status: Untriaged An issue that has yet to be triaged. Triage: Feature Request Indicates an issue requesting new functionality. and removed Status: Untriaged An issue that has yet to be triaged. labels Apr 22, 2020
@devopsdina
Copy link

@tas50 I think there are two potential used cases for motd.

  1. Providing the content inline with the resource for the motd (give a simple motd)
  2. Providing a path to a file or template with the content for the motd (complex motd)

Example of providing a simple motd

motd 'message name' do
  content "This is a secure system. blah blah blah"
  action :create # default action; other action :delete
end

Example of providing a source for a more complex motd

motd 'message name' do
  provide_source true # set to true to pass template/file (defaults to false)
  cookbook 'current_cookbook' # defaults to current cookbook
  source 'path/to/template.erb'
  action :create # default action; other action :delete
end

@devopsdina
Copy link

@tas50 simple motd resource functional for linux + windows: https://github.com/devopsdina/motd

Just need help moving this into core!

@tas50
Copy link
Contributor Author

tas50 commented Jun 6, 2020

You should be able to skip the provide_source bit and just use the source if a source is set. Other than that the design in the docs here lookos good to me.

@devopsdina
Copy link

devopsdina commented Jun 22, 2020

@tas50 Simple and Complex motd should be working now: https://github.com/devopsdina/motd

Tested with the latest chef client (16.2), with the new resource changes https://docs.chef.io/release_notes/#breaking-change-in-resources, and backwards down to chef 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus: Resources Triage: Feature Request Indicates an issue requesting new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants