def build_entity(self):
     return otypes.Host(
         id=self._module.params.get('id'),
         name=self.param('name'),
         cluster=otypes.Cluster(
             name=self.param('cluster')
         ) if self.param('cluster') else None,
         comment=self.param('comment'),
         address=self.param('address'),
         root_password=self.param('password'),
         ssh=otypes.Ssh(
             authentication_method=otypes.SshAuthenticationMethod.PUBLICKEY if self.param('public_key') else None,
             port=self.param('ssh_port'),
         ),
         spm=otypes.Spm(
             priority=self.param('spm_priority'),
         ) if self.param('spm_priority') else None,
         override_iptables=self.param('override_iptables'),
         display=otypes.Display(
             address=self.param('override_display'),
         ) if self.param('override_display') else None,
         os=otypes.OperatingSystem(
             custom_kernel_cmdline=' '.join(self.param('kernel_params')),
         ) if self.param('kernel_params') else None,
         power_management=otypes.PowerManagement(
             enabled=self.param('power_management_enabled'),
             kdump_detection=self.param('kdump_integration') == 'enabled',
         ) if self.param('power_management_enabled') is not None or self.param('kdump_integration') else None,
         vgpu_placement=otypes.VgpuPlacement(
             self.param('vgpu_placement')
         ) if self.param('vgpu_placement') is not None else None,
     )
 def build_entity(self):
     return otypes.Host(
         name=self.param('name'),
         cluster=otypes.Cluster(
             name=self.param('cluster')
         ) if self.param('cluster') else None,
         comment=self.param('comment'),
         address=self.param('address'),
         root_password=self.param('password'),
         ssh=otypes.Ssh(
             authentication_method=otypes.SshAuthenticationMethod.PUBLICKEY,
         ) if self.param('public_key') else None,
         kdump_status=otypes.KdumpStatus(
             self.param('kdump_integration')
         ) if self.param('kdump_integration') else None,
         spm=otypes.Spm(
             priority=self.param('spm_priority'),
         ) if self.param('spm_priority') else None,
         override_iptables=self.param('override_iptables'),
         display=otypes.Display(
             address=self.param('override_display'),
         ) if self.param('override_display') else None,
         os=otypes.OperatingSystem(
             custom_kernel_cmdline=' '.join(self.param('kernel_params')),
         ) if self.param('kernel_params') else None,
         power_management=otypes.PowerManagement(
             enabled=self.param('power_management_enabled'),
         ) if self.param('power_management_enabled') is not None else None,
     )
Exemplo n.º 3
0
 def build_entity(self):
     return otypes.Host(
         name=self._module.params['name'],
         cluster=otypes.Cluster(
             name=self._module.params['cluster']
         ) if self._module.params['cluster'] else None,
         comment=self._module.params['comment'],
         address=self._module.params['address'],
         root_password=self._module.params['password'],
         ssh=otypes.Ssh(
             authentication_method=otypes.SshAuthenticationMethod.PUBLICKEY,
         ) if self._module.params['public_key'] else None,
         kdump_status=otypes.KdumpStatus(
             self._module.params['kdump_integration']
         ) if self._module.params['kdump_integration'] else None,
         spm=otypes.Spm(
             priority=self._module.params['spm_priority'],
         ) if self._module.params['spm_priority'] else None,
         override_iptables=self._module.params['override_iptables'],
         display=otypes.Display(
             address=self._module.params['override_display'],
         ) if self._module.params['override_display'] else None,
         os=otypes.OperatingSystem(
             custom_kernel_cmdline=' '.join(self._module.params['kernel_params']),
         ) if self._module.params['kernel_params'] else None,
     )
Exemplo n.º 4
0
 def build_entity(self):
     return otypes.Host(
         name=self._module.params['name'],
         cluster=otypes.Cluster(name=self._module.params['cluster'])
         if self._module.params['cluster'] else None,
         comment=self._module.params['comment'],
         address=self._module.params['address'],
         root_password=self._module.params['password'],
         ssh=otypes.Ssh(authentication_method='publickey', )
         if self._module.params['public_key'] else None,
         kdump_status=otypes.KdumpStatus(
             self._module.params['kdump_integration'])
         if self._module.params['kdump_integration'] else None,
         spm=otypes.Spm(priority=self._module.params['spm_priority'], )
         if self._module.params['spm_priority'] else None,
         override_iptables=self._module.params['override_iptables'],
     )