Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Windows-Agent is working but is doing nothing

60 views
Skip to first unread message

Mijarena “Mijarena” P.

unread,
Dec 7, 2024, 4:36:43 PM12/7/24
to Puppet Users
Hello there.

I do have strange Problem, at least for me and I do not find a solution.
It seems, that all is running well.

I do have almalinux 9 as server

[root@s01 manifests]# rpm -qa | grep puppet
puppet8-release-1.0.0-9.el9.noarch
puppet-agent-8.10.0-1.el9.x86_64
puppetserver-8.7.0-1.el9.noarch
[root@s01 manifests]#


On Windows I do have
PS C:\ProgramData\PuppetLabs\code\environments\production\manifests> puppet --version
8.10.0


PS C:\ProgramData\PuppetLabs\puppet\etc> puppet resource service puppet
service { 'puppet':
  ensure       => 'running',
  enable       => 'true',
  logonaccount => 'LocalSystem',
  provider     => 'windows',
}



This is the log on the server
[root@s01 manifests]# journalctl 2>&1 | tail -n 50 | grep puppet
Dez 07 21:24:46 s01.randondomain.bayern puppet-agent[16868]: Requesting catalog from s01.randondomain.bayern:8140 (192.168.0.107)
Dez 07 21:24:46 s01.randondomain.bayern puppet-agent[16868]: Catalog compiled by s01.randondomain.bayern
Dez 07 21:24:46 s01.randondomain.bayern puppet-agent[16868]: Applied catalog in 0.01 seconds


I did this
PS C:\ProgramData\PuppetLabs\puppet\var> sc stop puppet && sc start puppet --debug --trace
but there re no Errors in the eventlog:
------------------ eventlog ------------------------
- System
- Provider
[ Name] Puppet
- EventID 1
[ Qualifiers] 0
Version 0 Level 4 Task 0 Opcode 0 Keywords 0x80000000000000 - TimeCreated
[ SystemTime] 2024-12-07T19:11:01.4894555Z
EventRecordID 4274 Correlation - Execution
[ ProcessID] 38580 [ ThreadID] 0
Channel Application Computer jancis Security
- EventData
Executing agent with arguments: - -
--------------------- /eventlog ------------------------

This are the manifest files
[root@s01 manifests]# cat *pp
node default {
  notify { 'this node did not match any of the listed definitions': }
}
node 'jancis.randomdomain.bayern' {
  file { 'C:/tmp/jancis.txt':
    ensure  => 'present',
    content => 'This file is created by Puppet for the client jancis.',
  }
}
node 'ronald' {
  file { 'C:/tmp/ronald.txt':
    ensure  => 'present',
    content => 'This file is created by Puppet for the client ronald.',
  }
}
node 's01.randomdomain.bayern' {
  file { '/tmp/s01.txt':
    ensure  => 'present',
    content => 'This file is created by Puppet for the client s01.',
  }
}[root@s01 manifests]#


ronald is just a fake, because I wanted to test that this is not executed on Windows. I deleted that for another test but no different outcome
jancis should be executet, I tested it with jancis ony and with its fqdn
s01 is the server just to test functionality... and it is working

Linux/s01
[root@s01 manifests]# ls /tmp/s01.txt
/tmp/s01.txt


Windows/jancis
PS C:\ProgramData\PuppetLabs\code\environments\production\manifests> ls c:/tmp
PS C:\ProgramData\PuppetLabs\code\environments\production\manifests>


Well, it just is not happening!

I do not know where to look and what to do. No errors, puppetserver ca list --all lists all my certificates.
All is working nicely, except, that on the Windows client nothing is happening.

Any ideas?
Thanks for reading.

Martin Alfke

unread,
Dec 8, 2024, 6:28:42 AM12/8/24
to Puppet Users
You must put the puppet environment code on the Linux Puppet server.
/etc/puppetlabs/code/environments/production/manifests/*.pp

Windows systems can only act as Puppet agent.

hth,
Martin
> --
> 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...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/puppet-users/0290a305-656e-45c5-b48c-8f5a718e56f0n%40googlegroups.com.

Mijarena “Mijarena” P.

unread,
Dec 8, 2024, 4:59:02 PM12/8/24
to Puppet Users
Yes, there it is:

--------------- shell on s01 -----------------
[root@s01 manifests]# pwd
/etc/puppetlabs/code/environments/production/manifests
[root@s01 manifests]# ls
default.pp  jancis.pp  s01.pp
[root@s01 manifests]#
[root@s01 manifests]# systemctl status puppetserver
● puppetserver.service - puppetserver Service
     Loaded: loaded (/usr/lib/systemd/system/puppetserver.service; enabled; preset: disabled)
     Active: active (running) since Sat 2024-12-07 16:12:03 CET; 24h ago
    Process: 7710 ExecStart=/opt/puppetlabs/server/apps/puppetserver/bin/puppetserver start (code=exited, status=0/SUCCESS)
   Main PID: 7770 (java)
      Tasks: 65 (limit: 4915)
     Memory: 2.1G
        CPU: 4min 45.274s
     CGroup: /system.slice/puppetserver.service
             └─7770 /usr/bin/java --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED -Xms2g -Xmx2g -Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4jLogger -Dlogappender=F1 -XX:+CrashOnOutOfMemoryError -XX:ErrorFile=/var/log/puppetlabs/puppetserver/puppetserver_err_pid%p.log -cp "/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar:/opt/puppetlabs/server/data/puppetserver/jars/*" clojure.main -m puppetlabs.trapperkeeper.main --config /etc/puppetlabs/puppetserver/conf.d --bootstrap-config /etc/puppetlabs/puppetserver/services.d/,/opt/puppetlabs/server/apps/puppetserver/config/services.d/ --restart-file /opt/puppetlabs/server/data/puppetserver/restartcounter

Dez 07 16:12:02 s01.randomdomain.bayern puppetserver[7770]: 16:12:02,099 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@6daae415 - The date pattern is 'yyyy-MM-dd' from file name pattern '/var/log/puppetlabs/puppetserver/puppetserver-access-%d{yyyy-MM-dd}.%i.log.gz'.
Dez 07 16:12:02 s01.randomdomain.bayern puppetserver[7770]: 16:12:02,099 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@6daae415 - Roll-over at midnight.
Dez 07 16:12:02 s01.randomdomain.bayern puppetserver[7770]: 16:12:02,100 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@6daae415 - Setting initial period to 2024-12-07T15:09:58.215Z
Dez 07 16:12:02 s01.randomdomain.bayern puppetserver[7770]: 16:12:02,101 |-INFO in ch.qos.logback.core.model.processor.ImplicitModelHandler - Assuming default type [ch.qos.logback.access.PatternLayoutEncoder] for [encoder] property
Dez 07 16:12:02 s01.randomdomain.bayern puppetserver[7770]: 16:12:02,115 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: /var/log/puppetlabs/puppetserver/puppetserver-access.log
Dez 07 16:12:02 s01.randomdomain.bayern puppetserver[7770]: 16:12:02,115 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [/var/log/puppetlabs/puppetserver/puppetserver-access.log]
Dez 07 16:12:02 s01.randomdomain.bayern puppetserver[7770]: 16:12:02,115 |-INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler - Attaching appender named [FILE] to null
Dez 07 16:12:02 s01.randomdomain.bayern puppetserver[7770]: 16:12:02,115 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@4a8608b3 - End of configuration.
Dez 07 16:12:02 s01.randomdomain.bayern puppetserver[7770]: 16:12:02,115 |-INFO in ch.qos.logback.access.joran.JoranConfigurator@518853e7 - Registering current configuration as safe fallback point
Dez 07 16:12:03 s01.randomdomain.bayern systemd[1]: Started puppetserver Service.
[root@s01 manifests]#
-------------- /shell on s01---------------------

Martin Alfke schrieb am Sonntag, 8. Dezember 2024 um 12:28:42 UTC+1:
You must put the puppet environment code on the Linux Puppet server.
/etc/puppetlabs/code/environments/production/manifests/*.pp

Windows systems can only act as Puppet agent.

hth,
Martin


> On 7. Dec 2024, at 21:48, Mijarena “Mijarena” P. <mija...@gmail.com> wrote:
>

> [root@s01 manifests]# cat *pp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

Dirk Heinrichs

unread,
Dec 9, 2024, 2:02:56 AM12/9/24
to puppet...@googlegroups.com
Am Sonntag, dem 08.12.2024 um 07:41 -0800 schrieb Mijarena “Mijarena” P.:

Yes, there it is:

--------------- shell on s01 -----------------
[root@s01 manifests]# pwd
/etc/puppetlabs/code/environments/production/manifests
[root@s01 manifests]# ls
default.pp  jancis.pp  s01.pp

Anything in the report, that could give a hint? What happens if you run "puppet agent --test" on the Windows node? Do you get any errors?

Bye...

Dirk
-- 
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

Mijarena “Mijarena” P.

unread,
Dec 9, 2024, 6:59:03 AM12/9/24
to Puppet Users
Ah thanks, that was something I was looking for (absolute new to puppet and didn't found this switch somehow)

PS C:\ProgramData\PuppetLabs\code\environments\production\manifests> puppet agent --test
Info: Refreshing CA certificate
Info: Refreshed CA certificate: xxx
Info: Refreshing CRL
Info: Refreshed CRL: XXX
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Notice: Requesting catalog from s01.randomdomain.bayern:8140 (192.168.0.107)
Notice: Catalog compiled by s01.randomdomain.bayern
Info: Caching catalog for jancis
Info: Applying configuration version '1733744720'
Notice: this node did not match any of the listed definitions
Notice: /Stage[main]/Main/Node[default]/Notify[this node did not match any of the listed definitions]/message: defined 'message' as 'this node did not match any of the listed definitions'
Notice: Applied catalog in 0.04 seconds

Ok, now the question:
My certificate listens to the name "jancis"
I did tried to use both:
----------- snip ------------------
node 'jancis.randomdomain.bayern' {
node 'jancis' {
----------- /snip ----------------

[... some testing ...}

Ok, I do thank for the help, because of the hint with the test i did again edit jancis.pp to begin with
node 'jancis' {

... 

What should I say, now it worked ....
It looks even more weired to me now, but in my Sysadmin life I had a lot of weird things that never should have happend

So, again, thank you. Now I will dig myself deeper into puppet.

Regards, 
mijarena

Dirk Heinrichs

unread,
Dec 9, 2024, 8:14:57 AM12/9/24
to puppet...@googlegroups.com
Am Montag, dem 09.12.2024 um 03:59 -0800 schrieb Mijarena “Mijarena” P.:

Notice: Catalog compiled by s01.randomdomain.bayern
Info: Caching catalog for jancis

That's the problem. This doesn't match the node definition (from your first mail):

node 'jancis.randomdomain.bayern' {

HTH...

Mijarena “Mijarena” P.

unread,
Dec 9, 2024, 9:08:54 AM12/9/24
to Puppet Users
Well, I did had only "jancis" at first and it didn't worked, then I added the domainname. 
I just removed it again after your last post as another test.

Martin Alfke

unread,
Dec 14, 2024, 12:41:01 PM12/14/24
to puppet...@googlegroups.com
You can run
puppet config print certname
either as root or Administrator.

This will print the name which is used in the certificate.

Please be aware that this usually is the fqdn.
If the fqdn is changed, a new certificate will be generated.
If you set certname in puppet.conf file (agent section), the agent will use that provided name.


-- 
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages