Bug #1443

Hosts are shown as active.

Added by Oliver Weinmann over 5 years ago. Updated over 1 year ago.

Status:Closed
Priority:Normal
Assigned To:-
Category:-
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-

Description

Hi,

since a few days all my hosts are shown as active. It looks like foreman treats a notify (notice) as an applied manifest and marks the host active.

Regards,
Oliver

History

#1 Updated by Ohad Levy over 5 years ago

what is your puppet clients version your master? is there a difference between versions?

#2 Updated by Oliver Weinmann over 5 years ago

My puppetmaster is version 2.7.9 and my clients range from 2.6.9 to 2.7.1.

#3 Updated by Ohad Levy over 5 years ago

  • Status changed from New to Need more information

Oliver Weinmann wrote:

My puppetmaster is version 2.7.9 and my clients range from 2.6.9 to 2.7.1.

could you provide some reports examples?
turn reports=store on your master, and attach the yaml file to the ticket.

thanks

#4 Updated by Oliver Weinmann over 5 years ago

Hi,

here is what I have in yaml for one of the active hosts:

---
parameters:
puppetmaster: puppet.a.space.corp
foreman_env: &id001 production
owner_name: Oliver Weinmann
hostgroup: Repos
root_pw: ****
owner_email:
domainname: ""
classes:
- repos
environment: *id001

I noticed that the host has 3 notices in report. The same is for all the other hosts shown as active. But a notice should not be treated as active or?

#5 Updated by Jacob McCann about 5 years ago

I would vote to leave things as they are in foreman concerning this.

Puppet treats hosts as 'active' (changes made) when using 'notify' so I think foreman should continue to do so as well.

From 'puppet apply --help':

* --detailed-exitcodes:
  Provide transaction information via exit codes. If this is enabled, an exit
  code of '2' means there were changes, an exit code of '4' means there were
  failures during the transaction, and an exit code of '6' means there were both
  changes and failures.

And some code to see what puppet thinks of this:

hostA:~ # cat test.pp
notify{'test':}
hostA:~ # puppet apply --detailed-exitcodes test.pp
notice: test
notice: /Stage[main]//Notify[test]/message: defined 'message' as 'test'
notice: Finished catalog run in 0.26 seconds
hostA:~ # echo $?
2

As you see the exitcode is 2, meaning puppet treats this as if 'there were changes'. Basically the resource was applied to give the message.

And yes, my example isn't using a master/agent setup, but I'm sure if you tested it in that configuration the results would be the same.

#6 Updated by Ohad Levy about 5 years ago

  • Target version deleted (1.0)

#7 Updated by Oliver Weinmann almost 5 years ago

  • Status changed from Need more information to Closed

Closed. As long as you don't use notice in your mainfests it's fine.

#8 Updated by Amir Barkal over 1 year ago

Oliver Weinmann wrote:

Closed. As long as you don't use notice in your mainfests it's fine.

Is it possible to make Foreman ignore the Notify resource so that nodes will not appear to be active when using it in a manifest?

Also available in: Atom PDF