FAQ
Setting up a HA iSCSI / NFS target using this document,
http://www.linbit.com/fileadmin/tech-guides/ha-iscsi.pdf, and I am unable
to find a way to use the puppetlabs-corosync module to emulate this command

crm(live)configure# primitive p_drbd_coraid23 ocf:linbit:drbd \
  params drbd_resource=coraid23 \
  op monitor interval=29 role=Master \
  op monitor interval=31 role=Slave
crm(live)configure# ms ms_drbd_coraid23 p_drbd_coraid23 \
  meta master-max=1 master-node-max=1 \
  clone-max=2 clone-node-max=1 notify=true

I defined the cs_primitive type like this...


   cs_primitive {
     'p_drbd_coraid23':
       ensure => present,
       primitive_class => 'ocf',
       primitive_type => 'drbd',
       provided_by => 'linbit',
       promotable => true,
       parameters => {
         'drbd_resource' => 'coraid23'
       },
       operations => {
         'monitor' => {
           'interval' => '29',
           'role' => 'Master',
         },
         'monitor' => {
           'interval' => '31',
           'role' => 'Slave',
         }
       },
       metadata => {
         'master-max' => '1',
         'master-node-max' => '1',
         'clone-max' => '2',
         'clone-node-max' => '1',
         'notify' => 'true',
       };


What results is only 1 of the 2 operations being defined, and my guess is
that this is because of logic like this...

operations = {}
operations['monitor'] = a
operations['monitor'] = b

puts operations['monitor']
=> b

Any suggestions?

Thanks
- Trey

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/umlivTZTkS0J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Willi Fehler at Jul 21, 2014 at 3:41 pm
    I have the same problem.

    Am Sonntag, 24. Juni 2012 01:06:17 UTC+2 schrieb treydock:
    Setting up a HA iSCSI / NFS target using this document,
    http://www.linbit.com/fileadmin/tech-guides/ha-iscsi.pdf, and I am unable
    to find a way to use the puppetlabs-corosync module to emulate this command

    crm(live)configure# primitive p_drbd_coraid23 ocf:linbit:drbd \
    params drbd_resource=coraid23 \
    op monitor interval=29 role=Master \
    op monitor interval=31 role=Slave
    crm(live)configure# ms ms_drbd_coraid23 p_drbd_coraid23 \
    meta master-max=1 master-node-max=1 \
    clone-max=2 clone-node-max=1 notify=true

    I defined the cs_primitive type like this...


    cs_primitive {
    'p_drbd_coraid23':
    ensure => present,
    primitive_class => 'ocf',
    primitive_type => 'drbd',
    provided_by => 'linbit',
    promotable => true,
    parameters => {
    'drbd_resource' => 'coraid23'
    },
    operations => {
    'monitor' => {
    'interval' => '29',
    'role' => 'Master',
    },
    'monitor' => {
    'interval' => '31',
    'role' => 'Slave',
    }
    },
    metadata => {
    'master-max' => '1',
    'master-node-max' => '1',
    'clone-max' => '2',
    'clone-node-max' => '1',
    'notify' => 'true',
    };


    What results is only 1 of the 2 operations being defined, and my guess is
    that this is because of logic like this...

    operations = {}
    operations['monitor'] = a
    operations['monitor'] = b

    puts operations['monitor']
    => b

    Any suggestions?

    Thanks
    - Trey
    --
    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+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/8065d250-39f4-4ede-a3e9-4926fd738a2c%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Hunter Haugen at Jul 21, 2014 at 11:59 pm
    Reading through the type/provider code, it looks like it is not coded in a
    way to deal with entries with duplicate keys, and I don't see any open pull
    requests to deal with this either. The puppetlabs-corosync module is not
    currently under active development from the PL module team yet, though we
    are getting nearer to it as we work through our list. (And will be happy to
    merge any quality PRs that you find necessary.)

    Any pull requests to refactor it would be welcome! One potential
    backwards-compatible way to implement this would be for the providers to
    check for arrays of values of any operations hash entry, and create one
    entry per hash in the array. Such as:

           operations => {
             'monitor' => [
               {
                 'interval' => '29',
                 'role' => 'Master',
               },
               {
                 'interval' => '31',
                 'role' => 'Slave',
               }
             ]
           },

    It should continue to work as before if the value is not an array.

    -Hunter

    On Mon, Jul 21, 2014 at 8:41 AM, wrote:

    I have the same problem.

    Am Sonntag, 24. Juni 2012 01:06:17 UTC+2 schrieb treydock:
    Setting up a HA iSCSI / NFS target using this document,
    http://www.linbit.com/fileadmin/tech-guides/ha-iscsi.pdf, and I am
    unable to find a way to use the puppetlabs-corosync module to emulate this
    command

    crm(live)configure# primitive p_drbd_coraid23 ocf:linbit:drbd \
    params drbd_resource=coraid23 \
    op monitor interval=29 role=Master \
    op monitor interval=31 role=Slave
    crm(live)configure# ms ms_drbd_coraid23 p_drbd_coraid23 \
    meta master-max=1 master-node-max=1 \
    clone-max=2 clone-node-max=1 notify=true

    I defined the cs_primitive type like this...


    cs_primitive {
    'p_drbd_coraid23':
    ensure => present,
    primitive_class => 'ocf',
    primitive_type => 'drbd',
    provided_by => 'linbit',
    promotable => true,
    parameters => {
    'drbd_resource' => 'coraid23'
    },
    operations => {
    'monitor' => {
    'interval' => '29',
    'role' => 'Master',
    },
    'monitor' => {
    'interval' => '31',
    'role' => 'Slave',
    }
    },
    metadata => {
    'master-max' => '1',
    'master-node-max' => '1',
    'clone-max' => '2',
    'clone-node-max' => '1',
    'notify' => 'true',
    };


    What results is only 1 of the 2 operations being defined, and my guess is
    that this is because of logic like this...

    operations = {}
    operations['monitor'] = a
    operations['monitor'] = b

    puts operations['monitor']
    => b

    Any suggestions?

    Thanks
    - Trey
    --
    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+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/8065d250-39f4-4ede-a3e9-4926fd738a2c%40googlegroups.com
    <https://groups.google.com/d/msgid/puppet-users/8065d250-39f4-4ede-a3e9-4926fd738a2c%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    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+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAJaQvGCoHB%3D%3D-wjLe32rZF%2BJhnBWNx8skj8FFSYgyJz2NMex0Q%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Willi Fehler at Jul 22, 2014 at 4:16 pm
    Hi Trey,

    I'm using Hiera and changed now:

         p_drbd_jira:
           primitive_class: ocf
           primitive_type: drbd
           provided_by: linbit
           parameters:
             drbd_resource: jira
           operations:
             monitor:
               - {interval: '10s', role: 'Master'}
               - {interval: '20s', role: 'Slave'}

    puppet agent -t --debug:
    Error:
    /Stage[main]/H24-corosync::Config/H24-corosync::Resource[primitive]/Cs_primitive[p_drbd_jira]:
    Could not evaluate: undefined method `each_pair' for
    #<Array:0x000000037c9a68>

    My class to get the data from Hiera:

    class h24-corosync::config {

         $config = hiera('h24-corosync::config',
             {
                 property => {},
                 primitive => {},
                 colocation => {},
                 order => {},
                 group => {}
             })
         h24-corosync::resource { 'property':
             params => $config[property],
             defaults => {ensure => present}
         } ->
         h24-corosync::resource { 'primitive':
             params => $config[primitive],
             #defaults => {operations => {monitor => { 'interval' => '30s' }}}
         } ->
         h24-corosync::resource { 'group':
             params => $config[group]
         } ->
         h24-corosync::resource { 'colocation':
             params => $config[colocation]
         } ->
         h24-corosync::resource { 'order':
             params => $config[order]
         }

    }

    Which code do I have to change?

    Regards - Willi

    --
    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+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/00d52bf6-835d-47ca-9e71-6b569f78d89b%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Hunter Haugen at Jul 22, 2014 at 11:49 pm

    On Tue, Jul 22, 2014 at 9:16 AM, wrote:

    Hi Trey,

    I'm using Hiera and changed now:

    p_drbd_jira:
    primitive_class: ocf
    primitive_type: drbd
    provided_by: linbit
    parameters:
    drbd_resource: jira
    operations:
    monitor:
    - {interval: '10s', role: 'Master'}
    - {interval: '20s', role: 'Slave'}

    puppet agent -t --debug:
    Error:
    /Stage[main]/H24-corosync::Config/H24-corosync::Resource[primitive]/Cs_primitive[p_drbd_jira]:
    Could not evaluate: undefined method `each_pair' for
    #<Array:0x000000037c9a68>

    My class to get the data from Hiera:

    class h24-corosync::config {

    $config = hiera('h24-corosync::config',
    {
    property => {},
    primitive => {},
    colocation => {},
    order => {},
    group => {}
    })
    h24-corosync::resource { 'property':
    params => $config[property],
    defaults => {ensure => present}
    } ->
    h24-corosync::resource { 'primitive':
    params => $config[primitive],
    #defaults => {operations => {monitor => { 'interval' => '30s' }}}
    } ->
    h24-corosync::resource { 'group':
    params => $config[group]
    } ->
    h24-corosync::resource { 'colocation':
    params => $config[colocation]
    } ->
    h24-corosync::resource { 'order':
    params => $config[order]
    }

    }

    Which code do I have to change?
    You will have to update the provider code at
    https://github.com/puppetlabs/puppetlabs-corosync/tree/master/lib/puppet/provider/cs_primitive
    to support array values of the cs_primitive operations hash. If you take
    the time to do this and send a pull request on github, that would be great
    :).

    Regards - Willi

    --
    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+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/00d52bf6-835d-47ca-9e71-6b569f78d89b%40googlegroups.com
    <https://groups.google.com/d/msgid/puppet-users/00d52bf6-835d-47ca-9e71-6b569f78d89b%40googlegroups.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    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+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAJaQvGBfL_sSZXDNpp%3DRc33udax5ynh7AOShbdFoez%3DgetroYw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJun 23, '12 at 11:06p
activeJul 22, '14 at 11:49p
posts5
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase