Hi Timu,

On Tue, Jul 23, 2013 at 3:51 AM, tinu <tinu.walt...@gmail.com> wrote:

> This manifest get the error above.
>
> class services::scomagent (
>     $install_source = 'puppet:///modules/services/MOMAgent.msi',
>     $msi_source = 'C:\Install\MOMAgent.msi',
>     $msi_install_dir = '"C:\\Program Files\\System Center Operations
> Manager 2007"',
>

The `install_options` parameter will automatically quote options with
spaces in them. As it is now, if puppet actually did try to install the
package, it would pass INSTALLDIR=""C:\Program Files\System Center
Operations Manager 2007"" on the command line, which may confuse
msiexec.exe.


>     $msi_package_name = "System Center Operations Manager 2007 R2 Agent",
>     $msi_logfile =
> 'C:\ProgramData\PuppetLabs\puppet\var\log\$msi_package_name.log'
>

Since you are using single quotes, the $msi_package_name will not be
interpolated. You'll need to change this to double quotes, and then escape
each backslash, e.g. "C:\\ProgramData\\...\\$msi_package_name.log"


> ){
>     file { 'C:\\Install':
>         ensure => directory,
>         mode => '0770',
>         owner => 'SYSTEM',
>         group => 'Administrators',
>     }
>     file { $msi_source:
>         ensure => file,
>         source => $install_source,
>         mode => '0770',
>         owner => 'SYSTEM',
>         group => 'Administrators',
>         require => file['C:\\Install']
>
>     }
>     package {'System Center Operations Manager 2007 R2 Agent':
>         ensure     => present,
>         provider => 'msi',
>

If you are using Puppet 3, the `msi` provider is deprecated. You'll want to
use `provider => 'windows'` or omit the provider parameter altogether.

        source     => $msi_source,
>         install_options    => {'INSTALLDIR' => $msi_install_dir},
>         require => file[$msi_source]
>     }
> }
>

This defines the services::scomagent class (which should be
Services::Scomagent to avoid the deprecation warnings below). But you still
need to declare an instance of that class. Typically that's done in your
node definition (assign which classes are applied to which nodes):

    class { 'services::scomagent': }

See also
http://docs.puppetlabs.com/puppet/3/reference/lang_node_definitions.html

puppet apply --debug --trace \\puppetmaster.domain.com
> \puppet\development\modules\services\manifests\scomagent.pp
>
> info: Loading facts in
> C:/ProgramData/PuppetLabs/puppet/var/lib/facter/defaultgateway.rb
> info: Loading facts in
> C:/ProgramData/PuppetLabs/puppet/var/lib/facter/networkadapters.rb
> warning: Deprecation notice:  Resource references should now be
> capitalized on line 21 in file //
> puppetmaster.domain.com/puppet/development/modules/services/manifests/scomagent.pp
> warning: Deprecation notice:  Resource references should now be
> capitalized on line 28 in file //
> puppetmaster.domain.com/puppet/development/modules/services/manifests/scomagent.pp
> debug: Creating default schedules
>
... snip ...

> info: Applying configuration version '1374561947'
>
... snip....

> notice: Finished catalog run in 0.09 seconds
> debug: Finishing transaction 39396972
> debug: Received report to process from server.domain.com
> debug: Processing report from server.domain.com with processor
> Puppet::Reports::Store
>
>
I don't see the error "change from absent to present failed: Failed to
install: The network name cannot be found." in the output above. I think
this is because you haven't declared an instance of your class.


> The agent is installed and can configure any other manifests. I can
> install the MSI with this manifest:
>
> class services::scomagent (
>     $install_source = 'puppet:///modules/services/MOMAgent.msi',
>     $msi_source = 'C:\Install\MOMAgent.msi',
>     $msi_install_dir = '"C:\\Program Files\\System Center Operations
> Manager 2007"',
>     $msi_package_name = "System Center Operations Manager 2007 R2 Agent",
>     $msi_logfile =
> 'C:\ProgramData\PuppetLabs\puppet\var\log\$msi_package_name.log'
> ){
>     file { 'C:\\Install':
>         ensure => directory,
>         mode => '0770',
>         owner => 'SYSTEM',
>         group => 'Administrators',
>     }
>     file { $msi_source:
>         ensure => file,
>         source => $install_source,
>         mode => '0770',
>         owner => 'SYSTEM',
>         group => 'Administrators',
>         require => file['C:\\Install']
>     }
>
>     $scom_server  = 'x3012app061.infra.be.ch'
>     $scom_mgmtgrp = 'a88a-scom'
>
>     $msiexec_path = 'c:\Windows\System32\msiexec.exe'
>     $install_command = "$msiexec_path /i $msi_source /qn
> INSTALLDIR=$msi_install_dir /L*v $msi_logfile USE_SETTINGS_FROM_AD=0
> MANAGEMENT_SERVER_DNS=$scom_server MANAGEMENT_GROUP=$scom_mgmtgrp
> ACTIONS_USE_COMPUTER_ACCOUNT=1 USE_MANUALLY_SPECIFIED_SETTINGS=1"
>     exec {"$msi_package_name":
>          command => $install_command,
>
>     }
> }
>

Josh

-- 
Josh Cooper
Developer, Puppet Labs

*Join us at PuppetConf 2013, August 22-23 in San Francisco - *
http://bit.ly/pupconf13*
**Register now and take advantage of the Final Countdown discount - save
15%!*

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to