summaryrefslogtreecommitdiff
path: root/lib/chef/resource
Commit message (Collapse)AuthorAgeFilesLines
* Make sure we define windows_task resource on *nix systemssp/7903backportTim Smith2018-11-091-231/+230
| | | | | | | | | Move the if windows statement from the entire resource to the actual place where we used Windows specific code. This makes it so we can use chefspec and the chef-resource-inspector for this resource. Signed-off-by: Tim Smith <tsmith@chef.io> (cherry picked from commit 8757bab03081dcbcec159614b67969a9387900bf)
* windows_ad_join: Switch to UPN format usernames for use with AD cmdletssp/fix7715-chef-14Stuart Preston2018-11-091-1/+1
| | | | Signed-off-by: Stuart Preston <stuart@chef.io>
* Merge pull request #7889 from chef/initramfs_14Tim Smith2018-11-071-13/+19
|\ | | | | Backport: Defer running initramfs_command until end of run
| * Defer running initramfs_command until end of runinitramfs_14Tom Doherty2018-11-071-13/+19
| | | | | | | | Signed-off-by: Tom Doherty <tom.doherty@fixnetix.com>
* | Merge pull request #7888 from chef/firewall_ports_14Tim Smith2018-11-071-14/+19
|\ \ | | | | | | Backport: Allow multiple local and remote ports in the windows_firewall_rule resource
| * | Coerce arrays of ints to an array of stringsfirewall_ports_14Tim Smith2018-11-071-2/+4
| | | | | | | | | | | | | | | | | | Otherwise it won't compare to the PS output Signed-off-by: Tim Smith <tsmith@chef.io>
| * | Allow passing multiple ports in windows_firewallTim Smith2018-11-071-14/+17
| |/ | | | | | | | | | | | | | | | | Allow ports to be an integer Allow ports to be a comma separated list or an array Workaround a bug in PowerShell where arrays that are converted to json turn into hashes with the count and the value The quotes around the port are removed because you can't pass '80,8080' in the cmdlet. It has to be a bare 80,8080 Signed-off-by: Tim Smith <tsmith@chef.io>
* | More tweaks to when we quote defaults in resource-inspectorTim Smith2018-11-071-1/+1
| | | | | | | | | | | | We were quoting a lot of odd things like empty arrays or empty strings. The original intent was to quote symbols. Let's just stick to that. Signed-off-by: Tim Smith <tsmith@chef.io>
* | More resource description updatesTim Smith2018-11-0722-36/+33
| | | | | | | | | | | | Better descriptions for many name properties and copy edits from the docs site. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Add additional descriptions to resource and update othersTim Smith2018-11-0710-33/+46
|/ | | | | | | Update descriptions to match the edits that were done to the docs site. Also fix windows_share to lazily eval the arrays, which is a bugfix + a docs fix the way we generate docs right now. Signed-off-by: Tim Smith <tsmith@chef.io>gi Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #7876 from chef/windows_firewall_14Tim Smith2018-11-051-0/+200
|\ | | | | Backport: Add windows_firewall_rule resource
| * Make windows_firewall a preview resourcewindows_firewall_14Tim Smith2018-11-051-0/+1
| | | | | | | | | | | | | | In master (chef-15) this wasn't necessary, but we want the cookbook to win for Chef 14. Signed-off-by: Tim Smith <tsmith@chef.io>
| * remove references to the cookbookTor Magnus Rakvåg2018-11-051-4/+0
| | | | | | | | Signed-off-by: Tor Magnus Rakvåg <tor.magnus@outlook.com>
| * port resource from cookbook, add descriptionsTor Magnus Rakvåg2018-11-051-0/+203
| | | | | | | | Signed-off-by: Tor Magnus Rakvåg <tor.magnus@outlook.com>
* | Merge pull request #7875 from chef/validations_14Tim Smith2018-11-056-9/+18
|\ \ | | | | | | Add more validation_messages to properties
| * | Add more validation_messages to propertiesTim Smith2018-11-056-9/+18
| |/ | | | | | | | | | | Provide users with more helpful messages Signed-off-by: Tim Smith <tsmith@chef.io>
* | Skip more resources and set others to desired state falseTim Smith2018-11-0517-19/+26
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | Properly deprecate visudo_path property in sudo resourceTim Smith2018-11-051-1/+1
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | Update descriptions and add default_description fieldsTim Smith2018-11-057-10/+10
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | Don't document state properties in systemd_unitTim Smith2018-11-051-4/+4
|/ | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* - Added `description` property on windows_task resourcebtm/14-backport-7777kapil chouhan2018-11-011-0/+4
| | | | Signed-off-by: kapil chouhan <kapil.chouhan@msystechnologies.com>
* Merge pull request #7831 from chef/dmg_package_14Tim Smith2018-10-311-39/+51
|\ | | | | Backport: Multiple fixes to dmg_package including functional EULA acceptance
| * Fix accepting the EULA not workingTim Smith2018-10-311-2/+5
| | | | | | | | | | | | Turns out it was breaking due to the quiet flag. Sadly there was a PR to turn off this flag from 3 years ago in the old cookbook repo :( Signed-off-by: Tim Smith <tsmith@chef.io>
| * Better detect currently installed packagesTim Smith2018-10-311-3/+3
| | | | | | | | | | | | Pulls in https://github.com/chef-boneyard/dmg/pull/24 which avoids the current regex like method and instead requires an exact match. Signed-off-by: Tim Smith <tsmith@chef.io>
| * memoize passphrase_cmdTim Smith2018-10-311-1/+1
| | | | | | | | | | | | We access this multiple times in this resource Signed-off-by: Tim Smith <tsmith@chef.io>
| * Move dmg attached check out to a helper methodTim Smith2018-10-311-1/+7
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * header property: Don't default to nil or accept nilTim Smith2018-10-311-2/+2
| | | | | | | | | | | | This is a old legacy leftover from LWRP-land Signed-off-by: Tim Smith <tsmith@chef.io>
| * Move more functionality to helper methods and propertiesTim Smith2018-10-311-13/+20
| | | | | | | | | | | | | | | | More passphrase_cmd and software_license_agreement over to helper methods that we can potentially test later on. Improve the requires EULA error message Use a default value for volumes_dir that sets it to the value of the app property instead of creating a variable later. Signed-off-by: Tim Smith <tsmith@chef.io>
| * Use full path to hdiutil and prevent finder opening the mounted dmg windowTim Smith2018-10-311-4/+4
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Don't rely on shelling out to grep to determine if EULA is necessaryTim Smith2018-10-311-3/+3
| | | | | | | | | | | | Do this natively in Ruby. Signed-off-by: Tim Smith <tsmith@chef.io>
| * Remove declare_resource usageTim Smith2018-10-311-4/+5
| | | | | | | | | | | | This isn't necessary since this is a custom resource Signed-off-by: Tim Smith <tsmith@chef.io>
| * Fix dmg_name to actually work the way it was meant toTim Smith2018-10-311-2/+3
| | | | | | | | | | | | We created a variable with the same name as the property and this probably did the right thing in Chef 11, but what we really want is dmg_name to take on the app name by default. Now it does. Signed-off-by: Tim Smith <tsmith@chef.io>
| * Remove logic that uniquely named the remote_file resourceTim Smith2018-10-311-2/+1
| | | | | | | | | | | | This was probably added before use_inline_resources was a thing Signed-off-by: Tim Smith <tsmith@chef.io>
| * Set desired state on several propertiesTim Smith2018-10-311-5/+6
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Add missing periods to the descriptionsTim Smith2018-10-311-2/+2
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Use current_value instead of the installed propertyTim Smith2018-10-311-8/+2
| | | | | | | | | | | | Remove the need for tracking state in the installed property Signed-off-by: Tim Smith <tsmith@chef.io>
* | Merge pull request #7833 from chef/windows_resources_14Tim Smith2018-10-312-0/+584
|\ \ | | | | | | Backport: Add windows_share and windows_certificate resources
| * | Update the introduced field to be 14.7Tim Smith2018-10-312-2/+2
| | | | | | | | | | | | | | | | | | I missed the 14.6 window Signed-off-by: Tim Smith <tsmith@chef.io>
| * | Auto mark windows_certificate as sensitive if a password is setTim Smith2018-10-312-3/+9
| | | | | | | | | | | | | | | | | | We're doing this same thing in the execute resource. Signed-off-by: Tim Smith <tsmith@chef.io>
| * | Description fixes from reviewTim Smith2018-10-312-6/+6
| | | | | | | | | | | | | | | | | | Thanks @stuartpreston Signed-off-by: Tim Smith <tsmith@chef.io>
| * | Add windows_certificate and windows_share resourcesTim Smith2018-10-312-0/+578
| |/ | | | | | | | | | | Move two additional resources over from the windows cookbook. With these moved we're pretty close to fully deprecating the windows cookbook. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Add macOS support to the timezone resourceTim Smith2018-10-311-32/+60
|/ | | | | | Moving towards a world where we properly load the current state. Adds a method that grabs the current timezone and properly fails with a warning message if we don't have the privs we need. Using converge_by and shell_out to set the timezone so we get a nice clean converge messaging vs. execute resources. Also improves the description to give a link to where users can find all the TZ options. Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #7811 from chef/docs_improvementsTim Smith2018-10-319-19/+20
|\ | | | | Automated resource documentation improvements
| * Add skip_docs and default_description to resource propertiesdocs_improvementsTim Smith2018-10-302-2/+3
| | | | | | | | | | | | | | | | | | skip_docs is used to specify a property that we don't want to include in the documentation. We have several of these. default_description is used to describe the default in a way we'd want to put on the docs site. This is particularly useful for describing all our lazy / computed values. I've used both of these in resources to show how I think we'll use them. Signed-off-by: Tim Smith <tsmith@chef.io>
| * Update description fields from the docs siteTim Smith2018-10-308-17/+17
| | | | | | | | | | | | Minor syncs from the docs site. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Allow passing array to supports in mount againarray_mountTim Smith2018-10-301-2/+2
|/ | | | | | | We try to coerce the array into a Hash, but we don't allow the Array value. This makes this actually work as we documented it. Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix locale on RHEL 6 / Amazon LinuxTim Smith2018-10-251-1/+1
| | | | | | There was a double source in the command, which would fail. Signed-off-by: Tim Smith <tsmith@chef.io>
* Add support for localized system account to windows_task resourceAnton Kvashenkin2018-10-161-238/+240
| | | | Signed-off-by: Anton Kvashenkin <anton.jugatsu@gmail.com>
* Shellout with an array for safetTim Smith2018-10-091-5/+1
| | | | | | | Simplifies this code a bit, but it also the safe thing to do in the event that the timezone has a space. Signed-off-by: Tim Smith <tsmith@chef.io>
* Add the timezone resource from the timezone_lwrp cookbookTim Smith2018-10-091-0/+95
| | | | | | Adding this resource to core Chef with permission from @dragonsmith Signed-off-by: Tim Smith <tsmith@chef.io>