arrow-right

Customising your MQ messaging setup

In this playground we will show you how easy it is to manage yourMQ messaging set-up with Puppet. How you can add and manage queues, topics, queues etc.

The playground system

The playground system contains a pre-installed puppet agent. There is no server available, so to run Puppet, you have to use the puppet apply command. The playground text will guide you with this.

On the playground system, you will find MQ already installed. We have installed it using the ibm_profile module. The playground will guide you in your customisations.

Working in the playground

Under this text, you see the working area. You can inspect the system and issue any command you like in the terminal. In the editor window, you can see the Puppet production environment. You can edit anything you wish. The documentation tab shows the documentation for the mq_config module.

Beware

This system will self destruct in about one hour. So please don’t use it to build or create anything you wish to keep!

Subjects in this playground

The playground contains the following sub paragraphs:
  • Add a MQ manager
  • Add a MQ topic
  • Add a MQ channel
  • Add MQ authorization
  • Add a MQ queue
Happy exploring!!

Add a MQ manager

In this section, we will create a MQ queue manager. It is needed to use the queue service. More information about queue managers you can find on IBM queue managers documentation website.
In the editor tab, go to the directory hierdata\nodes and open the file mq91.playground.enterprisemodules.com.yaml.
In the install playground, manager_setup was unskipped in the following line:

# ibm_profile::mq_machine::manager_setup:  skip

This tells Puppet to proceed with setting up Mq Manager based on data from yaml. Manager setup class, looks for the ibm_profile::mq_managers list. More detailes, can be found in the documentation. Your hiera should look something like this now:

# ibm_profile::mq_managers:
#   QM01: 
#     ensure:     present
#     chlauth:    ENABLED
#     chlev:      ENABLED
#     authorev:   ENABLED
#     inhibtev:   ENABLED
#     localev:    ENABLED
#     remoteev:   ENABLED
#     strstpev:   ENABLED
#     chlev:      EXCEPTION
#     sslev:      ENABLED
#     chadev:     ENABLED
#     perfmev:    ENABLED
#     configev:   ENABLED
#     cmdev:      NODISPLAY
#     deadq:      DLQ

Let’s uncomment the manager QM1, in the mq91.playground.enterprisemodules.com file.

ibm_profile::mq_managers:
  QM01: 
    ensure:     present
    chlauth:    ENABLED
    chlev:      ENABLED
    authorev:   ENABLED
    inhibtev:   ENABLED
    localev:    ENABLED
    remoteev:   ENABLED
    strstpev:   ENABLED
    chlev:      EXCEPTION
    sslev:      ENABLED
    chadev:     ENABLED
    perfmev:    ENABLED
    configev:   ENABLED
    cmdev:      NODISPLAY
    deadq:      DLQ

The parameter ensure in the yaml tell’s Puppet to ensure that manager with a name QM1, with given params, is present on the machine. More detailed params description can be found in the documentation.

Run Puppet

Let’s see what Puppet has got in store for us now and run Puppet.

puppet apply site.pp 

The result should be similar to the following:

Notice: Compiled catalog for mq91.playground.enterprisemodules.com in environment production in 0.87 seconds
Notice: MQ limits
Notice: MQ Groups and Users
Notice: MQ Packages
Notice: MQ version 9.1.0.0 software from /install
Notice: Ensure MQ Manager(s) QM01
Notice: /Stage[main]/Ibm_profile::Mq_machine::Manager_setup/Mq_manager[QM01]/status: status changed 'Ended immediately' to 'Running'
Notice: Applied catalog in 2.15 seconds

Re-run Puppet and check idempotency

What happens now if we run Puppet again:

puppet apply site.pp 

Puppet detects everything is as it is described in your Puppet manifest and hiera settings and changes nothing. It is idempotent.

Inspect changes

To see the result of applied changes, you can write the following command in the console:

puppet resource mq_manager

The result should be following:

mq_manager { 'QM01':
  ensure   => 'present',
  acctcono => 'DISABLED',
  acctint  => 1800,
  acctmqi  => 'OFF',
  acctq    => 'OFF',
  activrec => 'MSG',
  actvcono => 'DISABLED',
  actvtrc  => 'OFF',
  authorev => 'ENABLED',
  ccsid    => 819,
  certlabl => 'ibmwebspheremqqm01',
  certvpol => 'ANY',
  chad     => 'DISABLED',
  chadev   => 'ENABLED',
  chlauth  => 'ENABLED',
  chlev    => 'EXCEPTION',
  clwllen  => 100,
  clwlmruc => 999999999,
  clwluseq => 'LOCAL',
  cmdev    => 'NODISPLAY',
  configev => 'ENABLED',
  connauth => 'SYSTEM.DEFAULT.AUTHINFO.IDPWOS',
  deadq    => 'DLQ',
  defclxq  => 'SCTQ',
  imgintvl => 60,
  imglogln => 'OFF',
  imgrcovo => 'YES',
  imgrcovq => 'YES',
  imgsched => 'MANUAL',
  inhibtev => 'ENABLED',
  ipaddrv  => 'IPV4',
  localev  => 'ENABLED',
  loggerev => 'DISABLED',
  markint  => 5000,
  maxhands => 256,
  maxmsgl  => 4194304,
  maxpropl => 'NOLIMIT',
  maxumsgs => 10000,
  monacls  => 'QMGR',
  monchl   => 'OFF',
  monq     => 'OFF',
  perfmev  => 'ENABLED',
  provider => 'simple',
  psclus   => 'ENABLED',
  psmode   => 'ENABLED',
  psnpmsg  => 'DISCARD',
  psnpres  => 'NORMAL',
  psrtycnt => 5,
  pssyncpt => 'IFPER',
  remoteev => 'ENABLED',
  revdns   => 'ENABLED',
  routerec => 'MSG',
  schinit  => 'QMGR',
  scmdserv => 'QMGR',
  sslev    => 'ENABLED',
  sslfips  => 'NO',
  sslkeyr  => '/var/mqm/qmgrs/QM01/ssl/key',
  sslrkeyc => 0,
  statacls => 'QMGR',
  statchl  => 'OFF',
  statint  => 1800,
  statmqi  => 'OFF',
  statq    => 'OFF',
  status   => 'Running',
  strstpev => 'ENABLED',
  suiteb   => 'NONE',
  treelife => 1800,
  trigint  => 999999999,
}

More about puppet resource command will be written in the inside section. In this section, this command will be used to check results only.

Add a MQ topic

In this section, we will add a MQ topic to the queue manager.
In the editor tab, go to the directory hierdata\nodes and open the file mq91.playground.enterprisemodules.com.yaml.
Your hiera should look something like this now:

# ibm_profile::mq_machine::messaging_setup::topic_list:
#   QM01/TOPIC_1:
#     ensure:   present
#     descr:    My own topic
#     topicstr: topic_1

You can create mq_topic by uncommenting the code and running puppet. The same way as mq_manager was created, however this time it will be done a different way. Mq_topic is a type created by Enterprise Modules. You need to fill topicstr parameter and ensure parameter. Parameter ensure in the tell’s Puppet to ensure that topic with name QM01/TOPIC_1, with given params is present on the machine. More detailed params description can be found in the documentation.

Let’s uncomment following code:

ibm_profile::mq_machine::messaging_setup::channel_list:
  QM01/TOPIC_1:
    ensure:   present
    descr:    My own topic
    topicstr: topic_1

Run Puppet

Let’s see what Puppet has got in store for us now and run Puppet.

puppet apply a.pp 

The result should be similar to the following:

Notice: Compiled catalog for mq91.playground.enterprisemodules.com in environment production in 0.09 seconds
Notice: /Stage[main]/Main/Mq_topic[QM01/TOPIC_1]/ensure: created
Notice: Applied catalog in 1.70 seconds

Re-run Puppet and check idempotency

What happens now if we run Puppet again:

puppet apply site.pp 

Puppet detects everything is as it is described in your Puppet manifest and hiera settings and changes nothing. It is idempotent.

Inspect changes

To see the result of applied changes, you can write the following command in the console:

puppet resource mq_topic

The result should include the following:

mq_topic { 'QM01/TOPIC_1':
  ensure   => 'present',
  defpresp => 'ASPARENT',
  defprty  => 'ASPARENT',
  defpsist => 'ASPARENT',
  dursub   => 'ASPARENT',
  mcast    => 'ASPARENT',
  npmsgdlv => 'ASPARENT',
  pmsgdlv  => 'ASPARENT',
  provider => 'simple',
  proxysub => 'FIRSTUSE',
  pub      => 'ASPARENT',
  pubscope => 'ASPARENT',
  sub      => 'ASPARENT',
  subscope => 'ASPARENT',
  topicstr => 'topic_1',
  usedlq   => 'ASPARENT',
  wildcard => 'PASSTHRU',
}

More about puppet resource command will be written in the inside section. In this section, this command will be used to check results only.

Add a MQ channel

In this section we will add a channel to the MQ setup. Your hiera should look something like this now:
In the editor tab, go to the directory hierdata\nodes and open the file mq91.playground.enterprisemodules.com.yaml.
Your hiera should look something like this now:

# ibm_profile::mq_machine::messaging_setup::channel_list:
#   QM01/CHANNEL_1:
#     chltype:    SVRCONN
#     trptype:    TCP
#     mcauser :   'my_user'
#   QM01/ADMIN:
#     chltype:    SVRCONN
#     trptype:    TCP
#     mcauser :   'my_user'

Let’s uncomment following code:

ibm_profile::mq_machine::messaging_setup::channel_list:
  QM01/CHANNEL_1:
    chltype:    SVRCONN
    trptype:    TCP
    mcauser :   'my_user'
  QM01/ADMIN:
    chltype:    SVRCONN
    trptype:    TCP
    mcauser :   'my_user'

Mq_topic is a type created by Enterprise Modules. You need to fill the topicstr parameter and ensure parameter.
The parameter ensure in the tell’s Puppet to ensure that topic with the name QM01/TOPIC_2, with given params is present on the machine. More detailed params description can be found in the documentation.

Run Puppet

Let’s see what Puppet has got in store for us now and run Puppet. If you put your content in the yaml, you need to run

puppet apply side.pp 

The result should be similar to the following:

Notice: /Stage[main]/Main/Mq_channel[QM01/CHANNEL_1]/ensure: created
Notice: /Stage[main]/Main/Mq_channel[QM01/ADMIN]/ensure: created
Notice: Applied catalog in 4.08 seconds

Re-run Puppet and check idempotency

What happens now if we run Puppet again?
If you put your content in the yaml, you need to run

puppet apply side.pp 

Puppet detects everything is as it is described in your Puppet manifest and hiera settings and changes nothing. It is idempotent.

Inspect changes

To see the result of applied changes, you can write the following command in the console:

puppet resource mq_channel

The result should include the following:

mq_channel { 'QM01/AMQP/SYSTEM.DEF.AMQP':
  ensure   => 'present',
  amqpka   => 'AUTO',
  maxinst  => 999999999,
  maxmsgl  => 4194304,
  port     => 5672,
  provider => 'simple',
  sslcauth => 'REQUIRED',
  tproot   => 'SYSTEM.BASE.TOPIC',
  usecltid => 'NO',
}
mq_channel { 'QM01/CLNTCONN/SYSTEM.DEF.CLNTCONN':
  ensure   => 'present',
  affinity => 'PREFERRED',
  clntwght => 0,
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  defrecon => 'NO',
  hbint    => 300,
  kaint    => 'AUTO',
  maxmsgl  => 4194304,
  provider => 'simple',
  sharecnv => 10,
}
mq_channel { 'QM01/CLUSRCVR/SYSTEM.DEF.CLUSRCVR':
  ensure   => 'present',
  batchhb  => 0,
  batchint => 0,
  batchlim => 5000,
  batchsz  => 50,
  clwlprty => 0,
  clwlrank => 0,
  clwlwght => 50,
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  convert  => 'NO',
  discint  => 6000,
  hbint    => 300,
  kaint    => 'AUTO',
  longrty  => 999999999,
  longtmr  => 1200,
  maxmsgl  => 4194304,
  mcatype  => 'THREAD',
  monchl   => 'QMGR',
  mrrty    => 10,
  mrtmr    => 1000,
  netprty  => 0,
  npmspeed => 'FAST',
  propctl  => 'COMPAT',
  provider => 'simple',
  putaut   => 'DEF',
  seqwrap  => 999999999,
  shortrty => 10,
  shorttmr => 60,
  sslcauth => 'REQUIRED',
  statchl  => 'QMGR',
  usedlq   => 'YES',
}
mq_channel { 'QM01/CLUSSDR/SYSTEM.DEF.CLUSSDR':
  ensure   => 'present',
  batchhb  => 0,
  batchint => 0,
  batchlim => 5000,
  batchsz  => 50,
  clwlprty => 0,
  clwlrank => 0,
  clwlwght => 50,
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  convert  => 'NO',
  discint  => 6000,
  hbint    => 300,
  kaint    => 'AUTO',
  longrty  => 999999999,
  longtmr  => 1200,
  maxmsgl  => 4194304,
  mcatype  => 'THREAD',
  monchl   => 'QMGR',
  npmspeed => 'FAST',
  propctl  => 'COMPAT',
  provider => 'simple',
  seqwrap  => 999999999,
  shortrty => 10,
  shorttmr => 60,
  statchl  => 'QMGR',
  usedlq   => 'YES',
}
mq_channel { 'QM01/RCVR/SYSTEM.AUTO.RECEIVER':
  ensure   => 'present',
  batchsz  => 50,
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  descr    => 'Auto-defined by',
  hbint    => 300,
  kaint    => 'AUTO',
  maxmsgl  => 4194304,
  monchl   => 'QMGR',
  mrrty    => 10,
  mrtmr    => 1000,
  npmspeed => 'FAST',
  provider => 'simple',
  putaut   => 'DEF',
  seqwrap  => 999999999,
  sslcauth => 'REQUIRED',
  statchl  => 'QMGR',
  usedlq   => 'YES',
}
mq_channel { 'QM01/RCVR/SYSTEM.DEF.RECEIVER':
  ensure   => 'present',
  batchsz  => 50,
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  hbint    => 300,
  kaint    => 'AUTO',
  maxmsgl  => 4194304,
  monchl   => 'QMGR',
  mrrty    => 10,
  mrtmr    => 1000,
  npmspeed => 'FAST',
  provider => 'simple',
  putaut   => 'DEF',
  seqwrap  => 999999999,
  sslcauth => 'REQUIRED',
  statchl  => 'QMGR',
  usedlq   => 'YES',
}
mq_channel { 'QM01/RQSTR/SYSTEM.DEF.REQUESTER':
  ensure   => 'present',
  batchsz  => 50,
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  hbint    => 300,
  kaint    => 'AUTO',
  maxmsgl  => 4194304,
  mcatype  => 'PROCESS',
  monchl   => 'QMGR',
  mrrty    => 10,
  mrtmr    => 1000,
  npmspeed => 'FAST',
  provider => 'simple',
  putaut   => 'DEF',
  seqwrap  => 999999999,
  sslcauth => 'REQUIRED',
  statchl  => 'QMGR',
  usedlq   => 'YES',
}
mq_channel { 'QM01/SDR/SYSTEM.DEF.SENDER':
  ensure   => 'present',
  batchhb  => 0,
  batchint => 0,
  batchlim => 5000,
  batchsz  => 50,
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  convert  => 'NO',
  discint  => 6000,
  hbint    => 300,
  kaint    => 'AUTO',
  longrty  => 999999999,
  longtmr  => 1200,
  maxmsgl  => 4194304,
  mcatype  => 'PROCESS',
  monchl   => 'QMGR',
  npmspeed => 'FAST',
  propctl  => 'COMPAT',
  provider => 'simple',
  seqwrap  => 999999999,
  shortrty => 10,
  shorttmr => 60,
  statchl  => 'QMGR',
  usedlq   => 'YES',
}
mq_channel { 'QM01/SVR/SYSTEM.DEF.SERVER':
  ensure   => 'present',
  batchhb  => 0,
  batchint => 0,
  batchlim => 5000,
  batchsz  => 50,
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  convert  => 'NO',
  discint  => 6000,
  hbint    => 300,
  kaint    => 'AUTO',
  longrty  => 999999999,
  longtmr  => 1200,
  maxmsgl  => 4194304,
  mcatype  => 'PROCESS',
  monchl   => 'QMGR',
  npmspeed => 'FAST',
  propctl  => 'COMPAT',
  provider => 'simple',
  seqwrap  => 999999999,
  shortrty => 10,
  shorttmr => 60,
  sslcauth => 'REQUIRED',
  statchl  => 'QMGR',
  usedlq   => 'YES',
}
mq_channel { 'QM01/SVRCONN/ADMIN':
  ensure   => 'present',
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  discint  => 0,
  hbint    => 300,
  kaint    => 'AUTO',
  maxinst  => 999999999,
  maxinstc => 999999999,
  maxmsgl  => 4194304,
  mcauser  => 'my_user',
  monchl   => 'QMGR',
  provider => 'simple',
  sharecnv => 10,
  sslcauth => 'REQUIRED',
}
mq_channel { 'QM01/SVRCONN/CHANNEL_1':
  ensure   => 'present',
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  discint  => 0,
  hbint    => 300,
  kaint    => 'AUTO',
  maxinst  => 999999999,
  maxinstc => 999999999,
  maxmsgl  => 4194304,
  mcauser  => 'my_user',
  monchl   => 'QMGR',
  provider => 'simple',
  sharecnv => 10,
  sslcauth => 'REQUIRED',
}
mq_channel { 'QM01/SVRCONN/SYSTEM.AUTO.SVRCONN':
  ensure   => 'present',
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  descr    => 'Auto-defined by',
  discint  => 0,
  hbint    => 300,
  kaint    => 'AUTO',
  maxinst  => 999999999,
  maxinstc => 999999999,
  maxmsgl  => 4194304,
  monchl   => 'QMGR',
  provider => 'simple',
  sharecnv => 10,
  sslcauth => 'REQUIRED',
}
mq_channel { 'QM01/SVRCONN/SYSTEM.DEF.SVRCONN':
  ensure   => 'present',
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  discint  => 0,
  hbint    => 300,
  kaint    => 'AUTO',
  maxinst  => 999999999,
  maxinstc => 999999999,
  maxmsgl  => 4194304,
  monchl   => 'QMGR',
  provider => 'simple',
  sharecnv => 10,
  sslcauth => 'REQUIRED',
}

The result is quite long, and hard to read. To see one object only, use the name in the puppet resource command.
Example:

puppet resource mq_channel 'QM01/SVRCONN/CHANNEL_1'

The result should be following:

mq_channel { 'QM01/SVRCONN/CHANNEL_1':
  ensure   => 'present',
  comphdr  => 'NONE',
  compmsg  => 'NONE',
  discint  => 0,
  hbint    => 300,
  kaint    => 'AUTO',
  maxinst  => 999999999,
  maxinstc => 999999999,
  maxmsgl  => 4194304,
  mcauser  => 'my_user',
  monchl   => 'QMGR',
  provider => 'simple',
  sharecnv => 10,
  sslcauth => 'REQUIRED',
}

More about puppet resource command will be written in the inside section. In this section, this command will be used to check results only.

Add MQ authorization

In this section, we will add some authorization.
In the editor tab, go to the directory hierdata\nodes and open the file mq91.playground.enterprisemodules.com.yaml.
Your hiera should look something like this now:

# ibm_profile::mq_machine::authorization_setup::authorization_list:
#   group/mqm->QM01/topic/TOPIC_1:
#     ensure:     present
#     authority:  ['dlt', 'chg', 'dsp', 'clr', 'ctrl']
#   group/mqm->QM01/topic/TOPIC_2:
#     ensure:     present
#     authority:  ['dlt', 'chg', 'dsp', 'clr', 'ctrl']
#   group/mqm->QM01/queue/QUEUE_1:
#     ensure:     present
#     authority:  ['dlt', 'chg', 'dsp', 'clr']

You can create mq_authentication by uncommenting the code and running puppet.

ibm_profile::mq_machine::authorization_setup::authorization_list:
  group/mqm->QM01/topic/TOPIC_1:
    ensure:     present
    authority:  ['dlt', 'chg', 'dsp', 'clr', 'ctrl']
  group/mqm->QM01/topic/TOPIC_2:
    ensure:     present
    authority:  ['dlt', 'chg', 'dsp', 'clr', 'ctrl']
  group/mqm->QM01/queue/QUEUE_1:
    ensure:     present
    authority:  ['dlt', 'chg', 'dsp', 'clr']

Run Puppet

Let’s see what Puppet has got in store for us now and run Puppet.

puppet apply side.pp 

The result should be similar to the following:

Notice: MQ Authorizations settings
Notice: /Stage[main]/Ibm_profile::Mq_machine::Groups_and_users/User[mqm]/password: changed [redacted] to [redacted]
Notice: /Stage[main]/Ibm_profile::Mq_machine::Authorization_setup/Mq_authorization[group/mqm->QM01/topic/TOPIC_1]/authority: removing allmqi 
Notice: /Stage[main]/Ibm_profile::Mq_machine::Authorization_setup/Mq_authorization[group/mqm->QM01/topic/TOPIC_2]/ensure: created
Notice: /Stage[main]/Ibm_profile::Mq_machine::Authorization_setup/Mq_authorization[group/mqm->QM01/queue/QUEUE_1]/ensure: created
Notice: Applied catalog in 1.07 seconds

Re-run Puppet and check idempotency

What happens now if we run Puppet again:

puppet apply site.pp 

Puppet detects everything is as it is described in your Puppet manifest and hiera settings and changes nothing. It is idempotent.

Inspect changes

To see the result of applied changes, you can write the following command in the console:

puppet resource mq_authorization 'group/mqm->QM01/queue/QUEUE_1'
puppet resource mq_authorization 'group/mqm->QM01/topic/TOPIC_1'
puppet resource mq_authorization 'group/mqm->QM01/topic/TOPIC_2'

In the result you should see the following lines:

[root@mq91 manifests]# puppet resource mq_authorization 'group/mqm->QM01/queue/QUEUE_1'
mq_authorization { 'group/mqm->QM01/queue/QUEUE_1':
  ensure    => 'present',
  authority => ['dlt', 'chg', 'dsp', 'clr'],
  provider  => 'simple',
}
[root@mq91 manifests]# puppet resource mq_authorization 'group/mqm->QM01/topic/TOPIC_1'
mq_authorization { 'group/mqm->QM01/topic/TOPIC_1':
  ensure    => 'present',
  authority => ['dlt', 'chg', 'dsp', 'clr', 'ctrl'],
  provider  => 'simple',
}
[root@mq91 manifests]# puppet resource mq_authorization 'group/mqm->QM01/topic/TOPIC_2'
mq_authorization { 'group/mqm->QM01/topic/TOPIC_2':
  ensure    => 'present',
  authority => ['dlt', 'chg', 'dsp', 'clr', 'ctrl'],
  provider  => 'simple',
}

More about puppet resource command will be written in the inside section. In this section, this command will be used to check results only.

Removing puppet components

Uups, we have created mq_authorization object for TOPIC_2, but we don’t have TOPIC_2.
Let’s try to remove object mq_authorization 'group/mqm->QM01/topic/TOPIC_1'.
To do it, open hiera and change group/mqm->QM01/topic/TOPIC_2 in the following way:

group/mqm->QM01/topic/TOPIC_2:
  ensure:     absent

Notice, that even if you remove a component, you NEED to fill the required class parameters. You can remove other components like mq_topic, mq_channel or mq_manager in the same way.

Run Puppet

Let’s see what Puppet has got in store for us now and run Puppet.

puppet apply c.pp 

The result should be similar to the following:

Notice: Compiled catalog for mq91.playground.enterprisemodules.com in environment production in 0.05 seconds
Notice: /Stage[main]/Main/Mq_authorization[group/mqm->QM01/topic/TOPIC_2]/ensure: removed
Notice: Applied catalog in 0.51 seconds

Re-run Puppet and check idempotency

What happens now if we run Puppet again:

puppet apply c.pp 

Puppet detects everything is as it is described in your Puppet manifest and hiera settings and changes nothing. It is idempotent.

Inspect changes

To see the result of applied changes, you can write the following command in the console:

puppet resource mq_authorization 'group/mqm->QM01/topic/TOPIC_2'

The result should be the following:

mq_authorization { 'group/mqm->QM01/topic/TOPIC_2':
  ensure   => 'absent',
  provider => 'simple',
}

As you can see, group/mqm->QM01/topic/TOPIC_2 is absent.

More about puppet resource command will be written in the inside section. In this section, this command will be used to check results only.

Add a MQ queue

And last, but not least we will add a queue to the MQ setup.
In the editor tab, go to the directory hierdata\nodes and open the file mq91.playground.enterprisemodules.com.yaml.
Your hiera should look something like this now:

# ibm_profile::mq_machine::messaging_setup::queue_list:
#   QM01/QUEUE_1:
#     qtype:      QLOCAL
#     maxmsgl:    '10485760'
#     maxdepth:   '10000'
#     put:        ENABLED
#     get:        ENABLED
#     trigdpth:   '1'
#     trigmpri:   '0'
#     trigtype:   'FIRST' 

You can create mq_authentication by uncommenting the code and running puppet.

ibm_profile::mq_machine::messaging_setup::queue_list:
  QM01/QUEUE_1:
    qtype:      QLOCAL
    maxmsgl:    '10485760'
    maxdepth:   '10000'
    put:        ENABLED
    get:        ENABLED
    trigdpth:   '1'
    trigmpri:   '0'
    trigtype:   'FIRST' 

Run Puppet

Let’s see what Puppet has got in store for us now and run Puppet.

puppet apply side.pp 

The result should be similar to the following:

Notice: Compiled catalog for mq91.playground.enterprisemodules.com in environment production in 1.11 seconds
Notice: MQ limits
Notice: MQ Groups and Users
Notice: MQ Packages
Notice: MQ version 9.1.0.0 software from /install
Notice: Ensure MQ Manager(s) QM01
Notice: MQ Authorizations settings
Notice: MQ queue(s) QM01/QUEUE_1
Notice: /Stage[main]/Ibm_profile::Mq_machine::Messaging_setup/Mq_queue[QM01/QUEUE_1]/ensure: created
Notice: Applied catalog in 6.83 seconds

Now the queue is ready to use.

Re-run Puppet and check idempotency

What happens now if we run Puppet again:

puppet apply site.pp 

Puppet detects everything is as it is described in your Puppet manifest and hiera settings and changes nothing. It is idempotent.

You like it?

Do you like what you see here and want to test this on your own infrastructure? No problem. You can sign up for a free trial.

If you have any questions, don’t hesitate to contact us.

waiting
waiting