I have setup the Foreman 2.0.1 with Puppet 6.17.0. on Ubuntu 18.04. I have configured the Puppet run provider using the - puppet_proxy_ssh - run puppet over SSH.
I am able to push the Puppet Classes and Modules using Puppet Run Option couple of times and after few iterations I am getting the below error.
Error: - Disabling all modules in the group [‘puppet’] due to a failure in one of them: (): did not find expected key while parsing a block mapping at line 3 column 1
2020-08-18T04:38:29 [I] WEBrick::HTTPServer#start: pid=1319 port=8443
2020-08-18T04:38:29 [I] Smart proxy has launched on 1 socket(s), waiting for requests
2020-08-18T04:42:04 a08a2cb4 [I] Started POST /puppet/run
2020-08-18T04:42:04 a08a2cb4 [I] Finished POST /puppet/run with 404 (47.7 ms)
2020-08-18T04:42:42 909b2293 [I] Started GET /version
2020-08-18T04:42:42 909b2293 [I] Finished GET /version with 200 (0.37 ms)
2020-08-18T04:42:45 7d5ea374 [I] Started GET /tftp/serverName
2020-08-18T04:42:45 7d5ea374 [I] Finished GET /tftp/serverName with 200 (0.48 ms)
2020-08-18T04:42:45 dc330558 [I] Started GET /logs/ from_timestamp=0
2020-08-18T04:42:45 dc330558 [I] Finished GET /logs/ with 200 (1.05 ms)
2020-08-18T04:42:46 3992ebc6 [I] Started GET /puppet/ca
2020-08-18T04:42:46 9f04d620 [I] Started GET /puppet/ca/autosign
2020-08-18T04:42:46 9f04d620 [I] Finished GET /puppet/ca/autosign with 200 (0.66 ms)
2020-08-18T04:42:46 69ada7ca [I] Started GET /puppet/ca
2020-08-18T04:42:46 aff64a69 [I] Started GET /puppet/environments
2020-08-18T04:42:46 aff64a69 [I] Finished GET /puppet/environments with 404 (0.44 ms)
2020-08-18T04:42:46 c528b8af [I] Started GET /puppet/ca
2020-08-18T04:42:47 69ada7ca [I] Finished GET /puppet/ca with 200 (803.45 ms)
2020-08-18T04:42:47 c528b8af [I] Finished GET /puppet/ca with 200 (380.35 ms)
2020-08-18T04:42:47 3992ebc6 [I] Finished GET /puppet/ca with 200 (965.65 ms)
2020-08-18T04:57:17 [I] going to shutdown …
2020-08-18T04:57:17 [I] WEBrick::HTTPServer#start done.
2020-08-18T05:44:20 [E] Disabling all modules in the group [‘puppet’] due to a failure in one of them: (): did not find expected key while parsing a block mappingat line 3 column 1
The problem is in puppet.yml. You uncommented documentated rather than updating the use_provider option. Note that the foreman-installer can also set this up for you and is the recommended approach:
Please note the the “Puppet Run” functionality has been deprecated and will be removed in Foreman 2.2, in part due to the difficulty of setting it up properly (as well as the fact this functionality was removed from puppet itself many years ago). The recommended way of triggering a one-off puppet agent execution is using the Remote Execution plugin. Dropping "Run puppet" button with a replacement using remote execution plugin has more information.
SSL Issue is resolved. Now i am not getting any errors. But the problem is.
Problem:
When I am applying the classes on nodes using the puppet run options its not getting applied on the puppet nodes. Even I am not able to show any error or warnings in to the logs.
When i tried to check nodes reports form the foreman UI, it’s not generating the reports as well.
Reports are generated after 30 minutes and packages are also applied after 30 mins.
When I run the sudo /opt/puppetlabs/bin/puppet agent -t by login to the nodes clssess are immediately applied on the nodes.
Can you please help me to investigate more on this? If you need any more information on this please let me know.
I will appreciate your help!!
@tbrisker I will check for remote execution plugin and update you.
Is there anything in /var/log/foreman-proxy/proxy.log? Can you at least confirm Foreman sends the API request to Foreman Proxy? Is it making the SSH connection correctly? Can you see that on the target machine there is a log entry for that? Those are the steps that I would take.