puppet not recognizing supported modules - puppet

When I try to install basic Windows modules (new to puppet) they are not recognized when I try to add their classes to a new group.
When I list the modules I can see them, when I checked the production module path it is in the right place, why can't I see them in the GUI?
Thanks..
[root#puppetmaster ~]# puppet module list <br>
/etc/puppetlabs/code/environments/production/modules<br>
├── badgerious-windows_env (v2.2.2)<br>
├── chocolatey-chocolatey (v1.2.1)<br>
├── puppet-download_file (v1.2.1)<br>
├── puppet-iis (v1.4.1)<br>
├── puppet-windowsfeature (v1.1.0)<br>
├── puppetlabs-acl (v1.1.2)<br>
├── puppetlabs-apache (v1.8.0)<br>
├── puppetlabs-concat (v1.2.5)<br>
├── puppetlabs-powershell (v1.0.6)<br>
├── puppetlabs-reboot (v1.2.1)<br>
├── puppetlabs-registry (v1.1.3)<br>
├── puppetlabs-stdlib (v4.11.0)<br>
├── puppetlabs-windows (v2.1.1)<br>
└── puppetlabs-wsus_client (v1.0.1)<br>
/opt/puppetlabs/puppet/modules<br>
├── puppetlabs-pe_accounts (v2.0.2-6-gd2f698c)<br>
├── puppetlabs-pe_concat (v1.1.2-7-g77ec55b)<br>
├── puppetlabs-pe_console_prune (v0.1.1-9-gfc256c0)<br>
├── puppetlabs-pe_hocon (v2015.3.0-rc0)<br>
├── puppetlabs-pe_inifile (v1.1.4-16-gcb39966)<br>
├── puppetlabs-pe_java_ks (v1.2.4-37-g2d86015)<br>
├── puppetlabs-pe_nginx (v2015.2.0-rc0)<br>
├── puppetlabs-pe_postgresql (v3.4.4-35-g51cdb78)<br>
├── puppetlabs-pe_puppet_authorization (v2015.3.0-rc1-31-g6d266e1)<br>
├── puppetlabs-pe_puppetdbquery (v2015.3.0-rc1-1-gb278efd)<br>
├── puppetlabs-pe_r10k (v2015.2.2-2-g21c67b9)<br>
├── puppetlabs-pe_razor (v0.2.1-84-gbb045d2)<br>
├── puppetlabs-pe_repo (v2015.3.0-rc2-39-g796afc6)<br>
├── puppetlabs-pe_staging (v0.3.3-24-g2d5dbb0)<br>
└── puppetlabs-puppet_enterprise (v2015.3.1-1-g8c41b9f)<br>
[root#puppetmaster ~]# puppet config print modulepath --section master --environment production
/etc/puppetlabs/code/environments/production/modules:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules

In order to make the foreman GUI fetch installed modules, You need a foreman-proxy running with puppet.yml file enabled in it.
Note: I hope you have a working foreman-proxy running with puppet.yml
file enabled. If it's not running, please enable puppet in
foreman-proxy and configure proxy settings in foreman GUI. That's
enough to make the classes visible.
I also pasted my puppet.conf file, just incase if you need.
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
prerun_command=/etc/puppet/etckeeper-commit-pre
postrun_command=/etc/puppet/etckeeper-commit-post
environment=production
reports=log, foreman
[master]
dns_alt_names = yourdomain.com
certname=yourdomain.com
external_nodes=/etc/puppet/node.rb
node_terminus=exec
[agent]
server=yourdomain.com
listen=true
[production]
modulepath=/etc/puppetlabs/code/environments/production/modules

Related

Deployment error with docusaurus when trying to deploy via now to Vercel(Zeit)

I am facing a big problem while deploying to vercel via now.
I am able to successfully execute yarn run build and yarn run start, but when I am trying to deploy it via now.
I get this error
Error: You have 'doc' in your headerLinks, but no 'docs' folder exists one level up from 'website' folder. Did you run `docusaurus-init` or `npm run examples`? If so, make sure you rename 'docs-examples-from-docusaurus' to 'docs'.
2020-08-24T18:48:36.566Z at forEach (/vercel/58999d95/node_modules/docusaurus/lib/core/nav/HeaderNav.js:253:15)
2020-08-24T18:48:36.566Z at Array.forEach (<anonymous>)
2020-08-24T18:48:36.566Z at HeaderNav.renderResponsiveNav (/vercel/58999d95/node_modules/docusaurus/lib/core/nav/HeaderNav.js:248:17)
2020-08-24T18:48:36.566Z at HeaderNav.render (/vercel/58999d95/node_modules/docusaurus/lib/core/nav/HeaderNav.js:325:19)
2020-08-24T18:48:36.566Z at processChild (/vercel/58999d95/node_modules/react-dom/cjs/react-dom-server.node.development.js:3134:18)
2020-08-24T18:48:36.567Z at resolve (/vercel/58999d95/node_modules/react-dom/cjs/react-dom-server.node.development.js:2960:5)
2020-08-24T18:48:36.567Z at ReactDOMServerRenderer.render (/vercel/58999d95/node_modules/react-dom/cjs/react-dom-server.node.development.js:3435:22)
2020-08-24T18:48:36.567Z at ReactDOMServerRenderer.read (/vercel/58999d95/node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29)
2020-08-24T18:48:36.567Z at renderToStaticMarkup (/vercel/58999d95/node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27)
2020-08-24T18:48:36.567Z at renderToStaticMarkupWithDoctype (/vercel/58999d95/node_modules/docusaurus/lib/server/renderUtils.js:16:48)
2020-08-24T18:48:36.607Z error Command failed with exit code 1.
Here is my file structure.
example
├── Dockerfile
├── docker-compose.yml
├── docs
│ ├── doc1.md
│ ├── doc2.md
│ ├── doc3.md
│ ├── exampledoc4.md
│ └── exampledoc5.md
└── website
├── README.md
├── blog
│ ├── 2016-03-11-blog-post.md
│ ├── 2017-04-10-blog-post-two.md
│ ├── 2017-09-25-testing-rss.md
│ ├── 2017-09-26-adding-rss.md
│ └── 2017-10-24-new-version-1.0.0.md
├── core
│ └── Footer.js
├── package.json
├── pages
│ └── en
│ ├── help.js
│ ├── index.js
│ └── users.js
├── sidebars.json
├── siteConfig.js
├── static
│ ├── css
│ │ └── custom.css
│ └── img
│ ├── favicon.ico
│ ├── oss_logo.png
│ ├── undraw_code_review.svg
│ ├── undraw_monitor.svg
│ ├── undraw_note_list.svg
│ ├── undraw_online.svg
│ ├── undraw_open_source.svg
│ ├── undraw_operating_system.svg
│ ├── undraw_react.svg
│ ├── undraw_tweetstorm.svg
│ └── undraw_youtube_tutorial.svg
└── yarn.lock
Done in 0.57s.
This is actually generated via npx docusaurus-init, but still unable to deploy.
Any help would be highly appreciated :)
Fixed it by doing npm install and yarn run build

How to Edit homepage: skeleton generated by express generator

I am new to Node.js application development with expressjs framework.
I created a skeleton with expressjs-generator.
This skeleton have following directories and files:
.
├── app.js
├── bin
│ └── www
├── package.json
├── public
│ ├── images
│ ├── javascripts
│ └── stylesheets
│ └── style.css
├── routes
│ ├── index.js
│ └── users.js
└── views
├── error.jade
├── index.jade
└── layout.jade
After it: I use the following command to run this application.
set debug=myapp:* & start npm
Now this is successfully running at Port 3000
This shows the homepage with Express Welcome message.
I want to make change in Homepage of my application. How it can be possible?
You can do that by changing the index.jade as #brute_force mentioned. If you are not familiar with jade, you can also add a index.html in the public folder and update the index.html instead.

Change Yesod port number

From Deploying Yesod web app, I could copy the executable, static, and config file to run Yesod as a standalone web server. This is the directory structure.
├── config
│   ├── client_session_key.aes
│   ├── favicon.ico
│   ├── keter.yml
│   ├── models
│   ├── robots.txt
│   ├── routes
│   ├── settings.yml
│   ├── sqlite.yml
│   └── test-settings.yml
├── my-project
├── my-project.sqlite3
└── static
I tried to use different port by changing config/settings.yml
port: "_env:PORT:3002"
approot: "_env:APPROOT:http://localhost:3002"
However, the app is still accessible with port 3000. Even I removed the settings.yml, but there was no error message.
The way to change the port was from changing the environment variables export PORT=3002 from https://github.com/yesodweb/yesod/wiki/Configuration#overriding-configuration-values-with-environment-variables, but I it's not what I can use.
For development I can use stack exec -- yesod devel -p 3003 (how can I change the settings (e.g., port) used by "yesod devel"?), but I don't seem to use the -p option with the Yesod executable (my-project).
Why the executable does not (seem to) load config/settings? How to setup to use different port in Yesod web app?
It looks like that the setting file should be in the same directory as the executable.
I copied config/settings.yml in current directory, then run the ./my_project settings.yml, now it uses the 3002 port correctly.
I have some hints from https://github.com/yesodweb/yesod/issues/474

Foreman v1.7 Environment blank/null

Issue:
In Foreman I see the Environment column empty for this (and any other client) I try to add.
Environment:
I have a Foreman 1.7 Server with 2 additional Puppet masters (3.8.2) which are seen in Smart-Proxies and look healthy. I have created a new environment call 'destruct' which is defined in /etc/puppet/environments on all 3 servers with 'puppet' as the owner.
/etc/puppet/environments/destruct/
├── manifests
└── modules
└── linux_ntp
├── manifests
│   ├── config.pp
│   ├── init.pp
│   ├── install.pp
│   ├── params.pp
│   └── service.pp
├── metadata.json
├── Modulefile
├── Rakefile
├── README.markdown
├── spec
│   ├── spec_helper.rb
│   └── spec.opts
├── templates
│   └── ntp.conf.erb
└── tests
└── init.pp
The environments path is specified in the [master] section in puppet.conf in all 3 servers (foreman server + 2 external puppet masters) so directory environments should be in play.
environmentpath = /etc/puppet/environments
basemodulepath = /etc/puppet/modules
I added the 'destruct' environment in Foreman: Configure->Environments, after which I ran the import from all 3 servers and it did not try to remove it, and it did import that single ntp module.
When I attempt to add a new puppet agent I specify the environment as 'destruct' in puppet.conf:
report = true
pluginsync = true
masterport = 8140
certname = clientname.domain
server = puppetserver1.domain
listen = true
environment = destruct
ca_server = foremanserver1.domain
However in Foreman I see the Environment column empty for this (and any other client) I try to add. There are no errors on the puppet agent indicating it cannot find that environment.
I am able to manually assign a sever to an environment after it is in Foreman and successfully run modules, but that is far from ideal.
Any ideas why client systems are not being automatically assigned to the correct environment?
It appears that this behavior is expected. If you are using Foreman only as a puppet ENC then when a new sever is added via the puppet agent it does not auto-populate the Puppet Environment in Foreman based on what is in puppet.conf 'environment' variable, as I expected.
It looks like the best way is to create the Hosts in Foreman (via the API or WebUI) then your puppet environment in Foreman would be correctly applied.

Setting up environment directory - Getting Could not find default node or by name with XXX on environment other than "production"

I m currently trying to configure some directory environment to manage different clients
Puppet Master version : "puppet-server-3.8.1-1" (centos 6)
Here is my tree from the puppet master /etc/puppet :
├── organisation
│   ├── environment.conf
│   ├── manifests
│   │   ├── accounts.pp
│   │   ├── lab_accounts.pp
│   │   ├── lab_nodes.pp
│   │   └── nodes.pp
│   └── modules
│   ├── account
│   │   ├── files
│   │   ├── lib
│   │   ├── spec
│   │   │   └── classes
│   │   └── templates
│   └── dns
│   ├── manifests
│   │   └── init.pp
│   └── templates
│   ├── resolv.conf.erb
│   └── resolv.conf.fqdn.erb
├── production
│   ├── environment.conf
│   ├── manifests
│   │   ├── accounts.pp
│   │   ├── lab_accounts.pp
│   │   └── lab_nodes.pp
│   └── modules
│   ├── account
│   │   ├── CHANGELOG
│   │   ├── files
│   │   ├── lib
│   │   ├── LICENSE
│   │   ├── manifests
│   │   │   ├── init.pp
│   │   │   └── site.pp
│   │   ├── metadata.json
│   │   ├── Modulefile
│   │   ├── Rakefile
│   │   ├── README.mkd
│   │   ├── spec
│   │   │   ├── classes
│   │   │   ├── defines
│   │   │   │   └── account_spec.rb
│   │   │   └── spec_helper.rb
│   │   └── templates
│   ├── dns
│   │   ├── manifests
│   │   │   └── init.pp
│   │   └── templates
│   │   ├── resolv.conf.erb
│   │   └── resolv.conf.fqdn.erb
│   └── sshkeys
│   └── manifests
│   └── init.pp
└── README.md
Now the configuration files :
/etc/puppet.conf
[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
dns_alt_names = centos66a.local.lab,centos66a,puppet,puppetmaster
[master]
environmentpath = $confdir/environments
basemodulepath = $confdir/modules:/opt/puppet/share/puppet/modules
[agent]
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
server = puppet
Here is the environment I called "organisation" :
/etc/puppet/environments/organisation/environment.conf
modulepath = /etc/puppet/environments/organisation/modules
environment_timeout = 5s
Now I declare my nodes in "nodes.pp" :
/etc/puppet/environments/organisation/manifests/nodes.pp
node 'centos66a.local.lab' {
include dns
}
node 'gcacnt02.local.lab' {
include dns
}
Here is the output when I try to sync my node to the master :
gcacnt02:~ # hostname
gcacnt02.local.lab
gcacnt02:~ # puppet agent -t
Info: Creating a new SSL key for gcacnt02.local.lab
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for gcacnt02.local.lab
Info: Certificate Request fingerprint (SHA256): 49:73:11:78:99:6F:50:BD:6B:2F:5D:B9:92:7C:6F:A9:63:52:92:53:DB:B8:A1:AE:86:21:AF:36:BE:B0:94:DB
Info: Caching certificate for gcacnt02.local.lab
Info: Caching certificate for gcacnt02.local.lab
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find default node or by name with 'gcacnt02.local.lab, gcacnt02.local, gcacnt02' on node gcacnt02.local.lab
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
if I move /etc/puppet/environments/organisation/manifests/nodes.pp to /etc/puppet/environments/production/manifests/nodes.pp it works just fine.
When I print "manifest" from "organisation" and "production" I get a correct output asweel :
[root#centos66a environments]# puppet config print manifest --section master --environment production
/etc/puppet/environments/production/manifests
[root#centos66a environments]# puppet config print manifest --section master --environment organisation
/etc/puppet/environments/organisation/manifests
I m probably missing something here but can't put my finger on it...
Thank you
Problem resolved.
Configuration on the master is OK.
Since Puppet scan for directory in the environment directory set by the "environmentpath" variables, I thought that the master would automaticly reply to nodes in setup in each environment. This is false.
Default environment is : Production.
If you set any other environment you have to configure each puppet agent node to query to a specific environment
In my case, my node is gcacnt02.local.lab. So to fix the issue I had to add the following variable in /etc/puppet/puppet.conf
[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
[agent]
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
environment = lan

Resources