Ask Your Question
1

Assigning class to a run stage

asked 2013-06-19 08:25:43 -0500

banjer gravatar image

updated 2013-06-19 08:58:48 -0500

I need a little help with run stages. I understand how to create additional run stages beyond the default "main" stage and how to chain/order them, but I'm having trouble actually assigning classes to my stages. I have:

# /etc/puppet/modules/runstages/manifests/standard.pp
class runstages::standard {
    # declare additional run stages
    stage { 'stage01': }
    stage { 'stage02': }
    Stage['stage01'] -> Stage['stage02'] -> Stage['main']

    # assign classes to stages
    class {'authentication':
      stage => 'stage01',
    }
    class { 'nfs_mounts::standard':
      stage => 'stage02',
    }
}

This results in

Duplicate declaration: Class[Authentication] is already declared;

which is true...I have a puppet module called "authentication":

# /etc/puppet/modules ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-06-19 09:26:08 -0500

banjer gravatar image

Ended up figuring this out. I had to go into Foreman and "unassign" the authentication and nfs_mounts::standard classes from my hostgroup. As long as I have the runstages::standard class assigned to my hostgroup, then those classes are applied to the hosts, and in the correct order thanks to the run stages.

edit flag offensive delete link more
0

answered 2013-06-19 09:03:34 -0500

GregLarkin gravatar image

Move the metaparameters out of standard.pp and into each class definition and you should be all set.

edit flag offensive delete link more

Comments

Can you give me an example of the syntax? i.e. how would the init.pp now look for the authentication class?

banjer gravatar imagebanjer ( 2013-06-19 09:20:31 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-06-19 08:25:43 -0500

Seen: 1,147 times

Last updated: Jun 19 '13