Add new property for setting user

This commit is contained in:
Brantone 2022-03-07 20:51:29 -08:00
Родитель 5cf741454e
Коммит 8a8d68515f
2 изменённых файлов: 8 добавлений и 0 удалений

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

@ -8,6 +8,7 @@ property :cert_password, String, sensitive: true
property :keychain, String, required: true
property :kc_passwd, String, required: true, sensitive: true
property :apps, Array, default: []
property :user, String
property :sensitive, [true, false], default: false
action :install do
@ -15,6 +16,7 @@ action :install do
execute 'unlock keychain' do
command Array(cert.unlock_keychain(new_resource.kc_passwd))
user new_resource.user
sensitive new_resource.sensitive
end
@ -23,6 +25,7 @@ action :install do
execute 'install-certificate' do
command Array(cert.install_certificate(new_resource.cert_password, new_resource.apps))
user new_resource.user
sensitive new_resource.sensitive
not_if { find_cert_output.include? cert_shasum }
end

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

@ -5,6 +5,7 @@ default_action :create
property :kc_file, String
property :kc_passwd, String, sensitive: true
property :user, String
property :sensitive, [true, false], default: false
action_class do
@ -18,6 +19,7 @@ action :create do
execute 'create a keychain' do
command Array(keyc.create_keychain(new_resource.kc_passwd))
user new_resource.user
sensitive new_resource.sensitive
not_if { ::File.exist? keychain + '-db' }
end
@ -27,6 +29,7 @@ action :delete do
keyc = SecurityCommand.new('', keychain)
execute 'delete selected keychain' do
command Array(keyc.delete_keychain)
user new_resource.user
sensitive new_resource.sensitive
only_if { ::File.exist?(keychain) }
end
@ -36,6 +39,7 @@ action :lock do
keyc = SecurityCommand.new('', keychain)
execute 'lock selected keychain' do
command Array(keyc.lock_keychain)
user new_resource.user
sensitive new_resource.sensitive
only_if { ::File.exist?(keychain) }
end
@ -45,6 +49,7 @@ action :unlock do
keyc = SecurityCommand.new('', keychain)
execute 'unlock selected keychain' do
command Array(keyc.unlock_keychain(new_resource.kc_passwd))
user new_resource.user
sensitive new_resource.sensitive
only_if { ::File.exist?(keychain) }
end