This commit is contained in:
Eric Hanko 2017-06-02 21:58:12 -07:00
Родитель 70669afb0a
Коммит 422ac2f828
3 изменённых файлов: 104 добавлений и 94 удалений

Просмотреть файл

@ -2,11 +2,9 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="b8c9e35a-19d0-49b6-9bc8-ea0684d92e65" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/resources/systemsetup.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/../custom_web/test/cookbooks/hello_world_test/recipes/default.rb" afterPath="$PROJECT_DIR$/../custom_web/test/cookbooks/hello_world_test/recipes/default.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/recipes/default.rb" afterPath="$PROJECT_DIR$/recipes/default.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/resources/plist.rb" afterPath="$PROJECT_DIR$/resources/plist.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/resources/system_setting.rb" afterPath="$PROJECT_DIR$/resources/system_setting.rb" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
@ -44,8 +42,8 @@
<file leaf-file-name="system_setting.rb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/resources/system_setting.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="25" column="0" lean-forward="true" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
<state relative-caret-position="585">
<caret line="39" column="42" lean-forward="true" selection-start-line="39" selection-start-column="42" selection-end-line="39" selection-end-column="42" />
<folding />
</state>
</provider>
@ -84,8 +82,18 @@
<file leaf-file-name="default.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/recipes/default.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1005">
<caret line="67" column="3" lean-forward="true" selection-start-line="67" selection-start-column="3" selection-end-line="67" selection-end-column="3" />
<state relative-caret-position="240">
<caret line="25" column="0" lean-forward="true" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="disable_radio.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../changeos_setup/recipes/disable_radio.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="645">
<caret line="43" column="0" lean-forward="true" selection-start-line="43" selection-start-column="0" selection-end-line="43" selection-end-column="0" />
<folding />
</state>
</provider>
@ -271,41 +279,11 @@
<option name="myItemId" value="changeos_setup" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="test" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="recipes" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="macos-cookbook" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="changeos_setup" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="test" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="integration" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="default" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="serverspec" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="macos-cookbook" />
@ -598,12 +576,12 @@
<workItem from="1496337429240" duration="2471000" />
<workItem from="1496429645595" duration="411000" />
<workItem from="1496433293592" duration="16204000" />
<workItem from="1496459161628" duration="3979000" />
<workItem from="1496459161628" duration="6380000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="24877000" />
<option name="totallyTimeSpent" value="27278000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -651,14 +629,6 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/../vsts-agent-cookbook/resources/default.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315">
<caret line="21" column="21" lean-forward="false" selection-start-line="21" selection-start-column="21" selection-end-line="21" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../vsts-agent-cookbook/recipes/default.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
@ -799,14 +769,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../changeos_setup/recipes/disable_radio.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="59" lean-forward="true" selection-start-line="8" selection-start-column="40" selection-end-line="8" selection-end-column="59" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../changeos_setup/files/default/com.apple.finder.plist">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
@ -1016,14 +978,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/systemsetup.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="30" column="5" lean-forward="true" selection-start-line="28" selection-start-column="2" selection-end-line="30" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/plist.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
@ -1032,18 +986,42 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../changeos_setup/recipes/disable_radio.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="645">
<caret line="43" column="0" lean-forward="true" selection-start-line="43" selection-start-column="0" selection-end-line="43" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/systemsetup.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="30" column="5" lean-forward="true" selection-start-line="28" selection-start-column="2" selection-end-line="30" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/recipes/default.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1005">
<caret line="67" column="3" lean-forward="true" selection-start-line="67" selection-start-column="3" selection-end-line="67" selection-end-column="3" />
<state relative-caret-position="240">
<caret line="25" column="0" lean-forward="true" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$APPLICATION_HOME_DIR$/rubystubs23/string.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="16" column="6" lean-forward="false" selection-start-line="16" selection-start-column="6" selection-end-line="16" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/system_setting.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="25" column="0" lean-forward="true" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
<state relative-caret-position="585">
<caret line="39" column="42" lean-forward="true" selection-start-line="39" selection-start-column="42" selection-end-line="39" selection-end-column="42" />
<folding />
</state>
</provider>

Просмотреть файл

@ -29,40 +29,66 @@ file 'create hidden file' do
end
system_setting 'com.apple.bluetooth' do
preference 'ControllerPowerState'
enabled false
key 'ControllerPowerState'
set_to false
end
system_setting 'com.apple.finder' do
preference 'AppleShowAllFiles'
key 'AppleShowAllFiles'
set_to true
end
system_setting 'com.apple.TimeMachine' do
preference 'DoNotOfferNewDisksForBackup'
enabled false
key 'DoNotOfferNewDisksForBackup'
set_to false
end
system_setting 'com.apple.loginwindow' do
preference 'LoginwindowLaunchesRelaunchApps'
enabled false
key 'LoginwindowLaunchesRelaunchApps'
set_to false
end
system_setting 'com.apple.loginwindow' do
preference 'TALLogoutSavesState'
enabled false
key 'TALLogoutSavesState'
set_to false
end
system_setting 'com.apple.screensaver' do
preference 'idleTime'
enabled false
key 'idleTime'
set_to false
end
system_setting 'com.apple.driver.AppleHIDMouse' do
preference 'Button2'
key 'Button2'
set_to true
end
system_setting 'com.apple.bluetooth' do
preference 'ControllerPowerState'
enabled false
end
system_setting 'com.apple.Bluetooth' do
key 'ControllerPowerState'
set_to '0'
end
system_setting 'com.apple.Bluetooth' do
key 'BluetoothAutoSeekKeyboard'
set_to '0'
end
system_setting 'com.apple.Bluetooth' do
key 'BluetoothAutoSeekPointingDevice'
set_to '0'
end
system_setting 'sleep' do
set_to '0'
end
system_setting 'computersleep' do
set_to '0'
end
system_setting 'displaysleep' do
set_to '0'
end

Просмотреть файл

@ -24,19 +24,25 @@ default_action :set
systemsetup = '/usr/sbin/systemsetup'
defaults = '/usr/bin/defaults'
property :set_to, String
property :domain, String
property :preference, String, name_property: true
property :value, [String, Integer]
property :bin, String, equal_to: [systemsetup, defaults]
property :preference, String, name_property: true
property :set_to, [Hash, String, true, false]
property :key, String
property :value, [String, Integer]
load_current_value do |new_resource|
if shell_out("#{systemsetup} -listCommands | grep #{new_resource.setting}").exitstatus == 0
utility systemsetup
if shell_out("#{systemsetup} -printCommands | grep #{new_resource.preference}").exitstatus == 0
new_resource.bin systemsetup
else
utility defaults
new_resource.bin defaults
end
puts "\n\n++++++++++++++++++++++++++++++++++++"
puts "====> binary: #{new_resource.bin}"
puts "====> Preference: #{new_resource.preference}"
puts "====> Set to: #{new_resource.set_to}"
puts "====> Key: #{new_resource.key}"
puts "====> Value: #{new_resource.value}"
puts "++++++++++++++++++++++++++++++++++++\n"
end
action :set do
@ -49,10 +55,10 @@ action :set do
when defaults
execute 'set preference using defaults' do
user node['admin_user']
command "#{defaults} write #{new_resource.domain} #{new_resource.preference} #{set_to} #{new_resource.value}"
command "#{defaults} write #{new_resource.preference} #{new_resource.key} #{set_to} #{new_resource.value}"
end
else
pass
puts 'Unknown binary'
end
execute 'restart Finder' do