Puppet network device and define...

62 views
Skip to first unread message

Gavin Williams

unread,
Dec 20, 2012, 12:28:50 PM12/20/12
to puppe...@googlegroups.com
Afternoon all

I'm trying to use a defined resource with a puppet network device, so that I can group a whole load of network device resources into one define.

However when running puppet against the device, I see the following:

ESC[0;36mDebugESC[0m: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson
ESC[0;36mDebugESC[0m: Using cached catalog for actint-star-nactl01
Using cached catalog
ESC[0;36mDebugESC[0m: Creating default schedules
ESC[0;36mDebugESC[0m: Loaded state in 0.01 seconds
ESC[0;32mInfoESC[0m: Applying configuration version '1356022271'
ESC[0;36mDebugESC[0m: Stage[main]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Class[Main]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Node[actint-star-nactl01]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Class[Settings]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Class[Settings]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: /Filebucket[puppet]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Act::Util::Netapp::Database[volumes]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: /Stage[main]//Node[actint-star-nactl01]/Act::Util::Netapp::Database[volumes]/Notify[volume_defin]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: /Stage[main]//Node[actint-star-nactl01]/Notify[name]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Act::Util::Netapp::Database[volumes]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Node[actint-star-nactl01]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: /Stage[main]//Notify[environment]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Class[Main]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Stage[main]: Skipping host resources because running on a device
ESC[0;36mDebugESC[0m: Finishing transaction 69870015100020
ESC[0;36mDebugESC[0m: Storing state
ESC[0;36mDebugESC[0m: Stored state in 0.03 seconds
Finished catalog run in 0.25 seconds

My defined type looks like:
define act::util::netapp::database (
        $volumes
        ) {

  notify {'volume_defin':
    message => "Got to volume define.",
    #require => Exec['relink_libodm11.so'],
    #before  => Notify['configured_sysctl']
  }

        netapp_volume { 'v_puppet_test20122012':
                ensure => present,
                initsize => "10g",
                aggregate => "aggr01",
                spaceres => "none",
                snapreserve => 0,
                autoincrement => false,
                options => {'convert_ucode' => 'on', 'no_atime_update' => 'on', 'try_first' => 'volume_grow'}
        }

         netapp_qtree { 'q_puppet_test20122012':
                ensure => present,
                volume => 'v_puppet_test20122012',
                require => Netapp_volume['v_puppet_test20122012']
        }

         # Testing export path munge.
        netapp_export { '/vol/v_puppet_test20122012/q_puppet_test20122012':
                ensure => present,
                persistent => true,
                require => Netapp_qtree['q_puppet_test20122012']
        }

}

Currently, am just using a hard coded set to test, but once got it working once, will start putting variables in appropriate places.

Did a quick google of the above errors, and found Issue #11799, however it unfortunately doesn't have much information in it...

Any ideas on how I could get the above working???

Cheers
Gavin

Nan Liu

unread,
Dec 20, 2012, 1:08:12 PM12/20/12
to puppet-dev
You can't use notify resource with puppet devices =/. When working with F5, I simply duplicated notify and changed it f5_notify and updated f5_notify to apply_to_device. The network resources in the define resource should still work correctly.

Thanks,

Nan

fatmcgav

unread,
Dec 20, 2012, 3:03:46 PM12/20/12
to puppe...@googlegroups.com

Nan

Cheers for info.
Will drop the notify out and see how it behaves.

However shouldn't the other resources on the define still run?

They work correctly outside of a define, so I know it's not a provider issue.

Cheers
Gav

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Gavin Williams

unread,
Dec 21, 2012, 3:55:24 AM12/21/12
to puppe...@googlegroups.com
Ok, ignore my last...

Dropped the notify out of the define, and the device resources ran through without any issues...

Now to start putting variables in all the right places... ;)

Cheers
Gav

Brice Figureau

unread,
Dec 21, 2012, 3:59:15 AM12/21/12
to puppe...@googlegroups.com
Ouch, that sucks. It looks like notify should be a device type and an
host type.

Do we have a bug entry for this?

--
Brice Figureau
Follow the latest Puppet Community evolutions on www.planetpuppet.org!

Gavin Williams

unread,
Dec 21, 2012, 10:03:36 AM12/21/12
to puppe...@googlegroups.com
Quick update from me...

Have updated my defined resource to have some variables where appropriate, and have also used the 'create_resources' option within my node to handle the creation of multiple defined instances...

FYI, my defined type now looks like:
define act::util::netapp::database (
        $ensure,
        $size
        ) {

        #$filername = hiera('filer_name')
        #netapp_notify {"name":
        #       message => "Filer name = ${filername}"
        #}
        #->
        netapp_notify {"volume_define_${name}":
                message => "Got to volume define. Creating ${name}",

                #require => Exec['relink_libodm11.so'],
                #before  => Notify['configured_sysctl']
        }
        ->
        netapp_volume { "v_${name}":
                ensure => $ensure,
                initsize => $size,

                aggregate => "aggr01",
                spaceres => "none",
                snapreserve => 0,
                autoincrement => false,
                options => {'convert_ucode' => 'on', 'no_atime_update' => 'on', 'try_first' => 'volume_grow'}
        }
        ->
        netapp_qtree { "q_${name}":
                ensure => $ensure,
                volume => "v_${name}",
                #require => Netapp_volume['v_puppet_test20122012']
        }
        ->
        netapp_export { "/vol/v_${name}/q_${name}":
                ensure => $ensure,
                persistent => true,
                #require => Netapp_qtree['q_puppet_test20122012']
        }

}

And the node has got:
create_resources( act::util::netapp::database, hiera('volumes') )

Hiera data looks like:
---
filer_name: 'actint-star-nactl01'
volumes:
 puppet_db01_data:
  ensure: present
  size: "100g"
 puppet_db01_ctrl:
  ensure: present
  size: "50m"
 puppet_db01_redo:
  ensure: present
  size: "50g"

And hey presto, a puppet device run results in 3 new NetApp volumes created :D

Lets just say I'm well chuffed :D

Cheers
Gavin
Reply all
Reply to author
Forward
0 new messages