8000 Passing Noop to Included Classes · Issue #12 · trlinkin/trlinkin-noop · GitHub
[go: up one dir, main page]

Skip to content

Passing Noop to Included Classes #12

Open

Description

@jcitarello-ercot

Good day!

I am having trouble wrapping my head around something. I am currently moving to a roles and profiles methodology and would like to add noop to my role class for a given application stack. The idea is that want to add noop to the role class, but I need it to propogate through the profile class(es) and to the component class.

Noting that Puppets rules for roles state not to use resource-like declarations, I have a role:

class role::atlassian_jira (
$noop_mode = false,
){
noop($noop_mode)
include profile::atlassian_java
}

Where my profile looks like this...

#Class profile::atlassian_java
class profile::atlassian_java (
Optional[Boolean] $noop_mode,
){
if $facts['kernel'] == 'linux' {
class { 'package_java':
distribution => 'jdk',
noop_mode => $noop_mode,
packages => {
'jdk' => {
'archive_name' => 'jdk-11.0.6-linux-x64.rpm',
'package_name' => 'jdk-11.0.6',
'source_name' => 'jdk-11.0.6-linux-x64.rpm',
'source_version' => '11.0.6',
'package_version' => '11.0.6',
'version' => '11.0.6',
}
}
}
}
else {
fail("Kernel ${facts['kernel']} is not supported by ${module_name}.")
}
}

How do I keep a noop function in my component class (package_java) from using its own default, which would normally be set to false? Is this even possible?

Please advise, thanks!

Activity

  1. changed the title [-]Passing Noop to Includes Classes[/-] [+]Passing Noop to Included Classes[/+] on Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0