Method: Inspec::Resources::AzureVirtualMachine#ssh_key_count

Defined in:
lib/resources/azure/azure_virtual_machine.rb

#ssh_key_countObject

Return the number of ssh keys that have been assigned to the machine

Returns:

  • integer



192
193
194
195
196
197
198
# File 'lib/resources/azure/azure_virtual_machine.rb', line 192

def ssh_key_count
  if defined?(properties.osProfile.linuxConfiguration.ssh)
    properties.osProfile.linuxConfiguration.ssh.publicKeys.count
  else
    0
  end
end