summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-10-13 15:28:45 -0700
committerGitHub <noreply@github.com>2020-10-13 15:28:45 -0700
commit5db9e45acef63df4a9e17ae1838cf6f093d6e189 (patch)
tree17ec5cb050214d2f11753cd5e2681d63feadb3ae /lib
parent5b33f4142280f1796f56768372927047e4ea45af (diff)
parent02fc525ee6bbb9132b8978cdab6582bc24080799 (diff)
downloadchef-5db9e45acef63df4a9e17ae1838cf6f093d6e189.tar.gz
Merge pull request #10500 from chef/examples
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/apt_repository.rb5
-rw-r--r--lib/chef/resource/chef_client_config.rb7
-rw-r--r--lib/chef/resource/chef_client_cron.rb10
-rw-r--r--lib/chef/resource/chef_client_scheduled_task.rb8
-rw-r--r--lib/chef/resource/chef_client_systemd_timer.rb10
-rw-r--r--lib/chef/resource/chef_sleep.rb2
-rw-r--r--lib/chef/resource/cron/cron_d.rb4
-rw-r--r--lib/chef/resource/kernel_module.rb2
-rw-r--r--lib/chef/resource/launchd.rb30
-rw-r--r--lib/chef/resource/mount.rb2
10 files changed, 40 insertions, 40 deletions
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb
index 68f416df4c..da8ca78413 100644
--- a/lib/chef/resource/apt_repository.rb
+++ b/lib/chef/resource/apt_repository.rb
@@ -62,15 +62,14 @@ class Chef
end
```
- **Add the JuJu PPA, grab the key from the keyserver, and add source repo**:
+ **Add the JuJu PPA, grab the key from the Ubuntu keyserver, and add source repo**:
```ruby
apt_repository 'juju' do
- uri 'http://ppa.launchpad.net/juju/stable/ubuntu'
+ uri 'ppa:juju/stable'
components ['main']
distribution 'xenial'
key 'C8068B11'
- keyserver 'keyserver.ubuntu.com'
action :add
deb_src true
end
diff --git a/lib/chef/resource/chef_client_config.rb b/lib/chef/resource/chef_client_config.rb
index 4a4e8e4b1e..deee413ba4 100644
--- a/lib/chef/resource/chef_client_config.rb
+++ b/lib/chef/resource/chef_client_config.rb
@@ -109,7 +109,8 @@ class Chef
property :config_directory, String,
description: "The directory to store the client.rb in.",
- default: ChefConfig::Config.etc_chef_dir
+ default: ChefConfig::Config.etc_chef_dir,
+ default_description: "`/etc/chef/` on *nix-like systems and `C:\chef\` on Windows"
property :user, String,
description: "The user that should own the client.rb file and the configuration directory if it needs to be created. Note: The configuration directory will not be created if it already exists, which allows you to further control the setup of that directory outside of this resource."
@@ -118,9 +119,9 @@ class Chef
description: "The group that should own the client.rb file and the configuration directory if it needs to be created. Note: The configuration directory will not be created if it already exists, which allows you to further control the setup of that directory outside of this resource."
property :node_name, [String, NilClass], # this accepts nil so people can disable the default
- description: "The name of the node. This determines which configuration should be applied and sets the `client_name`, which is the name used when authenticating to a #{ChefUtils::Dist::Server::PRODUCT}. If this value is not provided #{ChefUtils::Dist::Infra::PRODUCT} will use the node's FQDN as the node name. Leaving this setting blank and letting the client assign the FQDN of the node as the node_name during each #{ChefUtils::Dist::Infra::PRODUCT} run is recommended.",
+ description: "The name of the node. This configuration sets the `node.name` value used in cookbooks and the `client_name` value used when authenticating to a #{ChefUtils::Dist::Server::PRODUCT} to determine what configuration to apply. Note: By default this configuration uses the `node.name` value which would be set during bootstrap. Hard coding this value in the `client.rb` config avoids logic within #{ChefUtils::Dist::Server::PRODUCT} that performs DNS lookups and may fail in the event of a DNS outage. To skip this default value and instead use the built-in #{ChefUtils::Dist::Server::PRODUCT} logic, set this property to `nil`",
default: lazy { node.name },
- default_description: "The `node.name` value. Hard coding this value in the client.rb avoids logic within #{ChefUtils::Dist::Server::PRODUCT} that performs DNS lookups and may fail in the event of a DNS outage. To skip this default value and instead use the built-in #{ChefUtils::Dist::Server::PRODUCT} logic, set this property to `nil`"
+ default_description: "The `node.name` value reported by #{ChefUtils::Dist::Infra::PRODUCT}."
property :chef_server_url, String,
description: "The URL for the #{ChefUtils::Dist::Server::PRODUCT}.",
diff --git a/lib/chef/resource/chef_client_cron.rb b/lib/chef/resource/chef_client_cron.rb
index 4dc1e1e5ad..003b28d7b3 100644
--- a/lib/chef/resource/chef_client_cron.rb
+++ b/lib/chef/resource/chef_client_cron.rb
@@ -32,23 +32,23 @@ class Chef
**Setup #{ChefUtils::Dist::Infra::PRODUCT} to run using the default 30 minute cadence**:
```ruby
- chef_client_cron "Run #{ChefUtils::Dist::Infra::PRODUCT} as a cron job"
+ chef_client_cron 'Run #{ChefUtils::Dist::Infra::PRODUCT} as a cron job'
```
**Run #{ChefUtils::Dist::Infra::PRODUCT} twice a day**:
```ruby
- chef_client_cron "Run #{ChefUtils::Dist::Infra::PRODUCT} every 12 hours" do
+ chef_client_cron 'Run #{ChefUtils::Dist::Infra::PRODUCT} every 12 hours' do
minute 0
- hour "0,12"
+ hour '0,12'
end
```
**Run #{ChefUtils::Dist::Infra::PRODUCT} with extra options passed to the client**:
```ruby
- chef_client_cron "Run an override recipe" do
- daemon_options ["--override-runlist mycorp_base::default"]
+ chef_client_cron 'Run an override recipe' do
+ daemon_options ['--override-runlist mycorp_base::default']
end
```
DOC
diff --git a/lib/chef/resource/chef_client_scheduled_task.rb b/lib/chef/resource/chef_client_scheduled_task.rb
index 617d452b1d..25780afdf4 100644
--- a/lib/chef/resource/chef_client_scheduled_task.rb
+++ b/lib/chef/resource/chef_client_scheduled_task.rb
@@ -30,7 +30,7 @@ class Chef
**Setup #{ChefUtils::Dist::Infra::PRODUCT} to run using the default 30 minute cadence**:
```ruby
- chef_client_scheduled_task "Run #{ChefUtils::Dist::Infra::PRODUCT} as a scheduled task"
+ chef_client_scheduled_task 'Run #{ChefUtils::Dist::Infra::PRODUCT} as a scheduled task'
```
**Run #{ChefUtils::Dist::Infra::PRODUCT} on system start**:
@@ -44,15 +44,15 @@ class Chef
**Run #{ChefUtils::Dist::Infra::PRODUCT} with extra options passed to the client**:
```ruby
- chef_client_scheduled_task "Run an override recipe" do
- daemon_options ["--override-runlist mycorp_base::default"]
+ chef_client_scheduled_task 'Run an override recipe' do
+ daemon_options ['--override-runlist mycorp_base::default']
end
```
**Run #{ChefUtils::Dist::Infra::PRODUCT} daily at 01:00 am, specifying a named run-list**:
```ruby
- chef_client_scheduled_task "Run chef-client named run-list daily" do
+ chef_client_scheduled_task 'Run chef-client named run-list daily' do
frequency 'daily'
start_time '01:00'
daemon_options ['-n audit_only']
diff --git a/lib/chef/resource/chef_client_systemd_timer.rb b/lib/chef/resource/chef_client_systemd_timer.rb
index ce250ea68d..e911fc2cb0 100644
--- a/lib/chef/resource/chef_client_systemd_timer.rb
+++ b/lib/chef/resource/chef_client_systemd_timer.rb
@@ -30,22 +30,22 @@ class Chef
**Setup #{ChefUtils::Dist::Infra::PRODUCT} to run using the default 30 minute cadence**:
```ruby
- chef_client_systemd_timer "Run #{ChefUtils::Dist::Infra::PRODUCT} as a systemd timer"
+ chef_client_systemd_timer 'Run #{ChefUtils::Dist::Infra::PRODUCT} as a systemd timer'
```
**Run #{ChefUtils::Dist::Infra::PRODUCT} every 1 hour**:
```ruby
- chef_client_systemd_timer "Run #{ChefUtils::Dist::Infra::PRODUCT} every 1 hour" do
- interval "1hr"
+ chef_client_systemd_timer 'Run #{ChefUtils::Dist::Infra::PRODUCT} every 1 hour' do
+ interval '1hr'
end
```
**Run #{ChefUtils::Dist::Infra::PRODUCT} with extra options passed to the client**:
```ruby
- chef_client_systemd_timer "Run an override recipe" do
- daemon_options ["--override-runlist mycorp_base::default"]
+ chef_client_systemd_timer 'Run an override recipe' do
+ daemon_options ['--override-runlist mycorp_base::default']
end
```
DOC
diff --git a/lib/chef/resource/chef_sleep.rb b/lib/chef/resource/chef_sleep.rb
index 219fac83a3..c6d3e45877 100644
--- a/lib/chef/resource/chef_sleep.rb
+++ b/lib/chef/resource/chef_sleep.rb
@@ -39,7 +39,7 @@ class Chef
chef_sleep 'wait for the service to start' do
seconds 10
end
- ````
+ ```
**Use a notification from another resource to sleep only when necessary**:
diff --git a/lib/chef/resource/cron/cron_d.rb b/lib/chef/resource/cron/cron_d.rb
index 8276fb8587..6262ef453a 100644
--- a/lib/chef/resource/cron/cron_d.rb
+++ b/lib/chef/resource/cron/cron_d.rb
@@ -62,7 +62,7 @@ class Chef
hour '8'
weekday '6'
mailto 'admin@example.com'
- command "/bin/true"
+ command '/bin/true'
action :create
end
```
@@ -76,7 +76,7 @@ class Chef
day '*'
month '11'
weekday '1-5'
- command "/bin/true"
+ command '/bin/true'
action :create
end
```
diff --git a/lib/chef/resource/kernel_module.rb b/lib/chef/resource/kernel_module.rb
index 87a1d79d24..485511470e 100644
--- a/lib/chef/resource/kernel_module.rb
+++ b/lib/chef/resource/kernel_module.rb
@@ -31,7 +31,7 @@ class Chef
kernel_module 'loop' do
options [
'max_loop=4',
- 'max_part=8'
+ 'max_part=8',
]
end
```
diff --git a/lib/chef/resource/launchd.rb b/lib/chef/resource/launchd.rb
index a6125f7981..c8e3d93afc 100644
--- a/lib/chef/resource/launchd.rb
+++ b/lib/chef/resource/launchd.rb
@@ -131,35 +131,35 @@ class Chef
description: "If a job dies, all remaining processes with the same process ID may be kept running. Set to true to kill all remaining processes."
property :debug, [ TrueClass, FalseClass ],
- description: "Sets the log mask to LOG_DEBUG for this job."
+ description: "Sets the log mask to `LOG_DEBUG` for this job."
property :disabled, [ TrueClass, FalseClass ], default: false,
- description: "Hints to launchctl to not submit this job to launchd."
+ description: "Hints to `launchctl` to not submit this job to launchd."
property :enable_globbing, [ TrueClass, FalseClass ],
description: "Update program arguments before invocation."
property :enable_transactions, [ TrueClass, FalseClass ],
- description: "Track in-progress transactions; if none, then send the SIGKILL signal."
+ description: "Track in-progress transactions; if none, then send the `SIGKILL` signal."
property :environment_variables, Hash,
description: "Additional environment variables to set before running a job."
property :exit_timeout, Integer,
- description: "The amount of time (in seconds) launchd waits before sending a SIGKILL signal."
+ description: "The amount of time (in seconds) launchd waits before sending a `SIGKILL` signal."
property :hard_resource_limits, Hash,
description: "A Hash of resource limits to be imposed on a job."
property :inetd_compatibility, Hash,
- description: "Specifies if a daemon expects to be run as if it were launched from inetd. Set to wait => true to pass standard input, output, and error file descriptors. Set to wait => false to call the accept system call on behalf of the job, and then pass standard input, output, and error file descriptors."
+ description: "Specifies if a daemon expects to be run as if it were launched from inetd. Set to `wait => true` to pass standard input, output, and error file descriptors. Set to `wait => false` to call the accept system call on behalf of the job, and then pass standard input, output, and error file descriptors."
property :init_groups, [ TrueClass, FalseClass ],
- description: "Specify if initgroups is called before running a job."
+ description: "Specify if `initgroups` is called before running a job."
property :keep_alive, [ TrueClass, FalseClass, Hash ],
introduced: "12.14",
- description: "Keep a job running continuously (true) or allow demand and conditions on the node to determine if the job keeps running (false)."
+ description: "Keep a job running continuously (true) or allow demand and conditions on the node to determine if the job keeps running (`false`)."
property :launch_events, [ Hash ],
introduced: "15.1",
@@ -191,10 +191,10 @@ class Chef
callbacks: { "should be a Integer between -20 and 19" => proc { |v| v >= -20 && v <= 19 } }
property :on_demand, [ TrueClass, FalseClass ],
- description: "Keep a job alive. Only applies to macOS version 10.4 (and earlier); use keep_alive instead for newer versions."
+ description: "Keep a job alive. Only applies to macOS version 10.4 (and earlier); use `keep_alive` instead for newer versions."
property :process_type, String,
- description: "The intended purpose of the job: Adaptive, Background, Interactive, or Standard."
+ description: "The intended purpose of the job: `Adaptive`, `Background`, `Interactive`, or `Standard`."
property :program, String,
description: "The first argument of execvp, typically the file name associated with the file to be executed. This value must be specified if program_arguments is not specified, and vice-versa."
@@ -206,7 +206,7 @@ class Chef
description: "An array of non-empty directories which, if any are modified, will cause a job to be started."
property :root_directory, String,
- description: "chroot to this directory, and then run the job."
+ description: "`chroot` to this directory, and then run the job."
property :run_at_load, [ TrueClass, FalseClass ],
description: "Launch a job once (at the time it is loaded)."
@@ -218,13 +218,13 @@ class Chef
description: "A Hash of resource limits to be imposed on a job."
property :standard_error_path, String,
- description: "The file to which standard error (stderr) is sent."
+ description: "The file to which standard error (`stderr`) is sent."
property :standard_in_path, String,
- description: "The file to which standard input (stdin) is sent."
+ description: "The file to which standard input (`stdin`) is sent."
property :standard_out_path, String,
- description: "The file to which standard output (stdout) is sent."
+ description: "The file to which standard output (`stdout`) is sent."
property :start_interval, Integer,
description: "The frequency (in seconds) at which a job is started."
@@ -239,7 +239,7 @@ class Chef
description: "The amount of time (in seconds) a job may be idle before it times out. If no value is specified, the default timeout value for launchd will be used."
property :umask, Integer,
- description: "A decimal value to pass to umask before running a job."
+ description: "A decimal value to pass to `umask` before running a job."
property :username, String,
description: "When launchd is run as the root user, the user to run the job as."
@@ -251,7 +251,7 @@ class Chef
description: "An array of paths which, if any are modified, will cause a job to be started."
property :working_directory, String,
- description: "Chdir to this directory, and then run the job."
+ description: "`chdir` to this directory, and then run the job."
end
end
end
diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb
index f6dd4f70f0..ed5d9a0e0b 100644
--- a/lib/chef/resource/mount.rb
+++ b/lib/chef/resource/mount.rb
@@ -84,7 +84,7 @@ class Chef
description: "Windows only: Use to specify the user name."
property :domain, String,
- description: "Windows only: Use to specify the domain in which the username and password are located."
+ description: "Windows only: Use to specify the domain in which the `username` and `password` are located."
private