puppet: puppetDB and templatedir - puppet

I installed some puppet server and puppetDB:
[root#her code]# puppet master --version
4.3.1
[root#her code]# uname -a
Linux her 3.10.0-327.3.1.el7.x86_64 #1 SMP Wed Dec 9 14:09:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root#her code]# cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core)
[root#her code]# rpm -qa | grep pupp
puppetlabs-release-pc1-1.0.0-1.el7.noarch
puppet-agent-1.3.2-1.el7.x86_64
puppetserver-2.2.1-1.el7.noarch
[root#her code]# puppet module list
/etc/puppetlabs/code/environments/production/modules
+-- puppetlabs-apt (v2.2.1)
+-- puppetlabs-concat (v1.2.5)
+-- puppetlabs-firewall (v1.7.2)
+-- puppetlabs-inifile (v1.4.3)
+-- puppetlabs-postgresql (v4.6.1)
+-- puppetlabs-puppetdb (v5.0.0)
L-- puppetlabs-stdlib (v4.10.0)
/etc/puppetlabs/code/modules (no modules installed)
/opt/puppetlabs/puppet/modules (no modules installed)
this man
and now i have some questions:
How to know than puppetDB is work? I can't see it in 'ps ax' output, that's ok?
[root#her code]# ps ax | grep pupp | grep -v grep
23423 ? Ssl 1:41 /usr/bin/java -Xms2g -Xmx2g -XX:MaxPermSize=256m -XX:OnOutOfMemoryError=kill -9 %p -Djava.security.egd=/dev/urandom -cp /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar clojure.main -m puppetlabs.trapperkeeper.main --config /etc/puppetlabs/puppetserver/conf.d -b /etc/puppetlabs/puppetserver/bootstrap.cfg
[root#her code]# ps ax | grep sql | grep -v grep
Where i can set templatedir? In puppet 3.8 it's done in /etc/puppet/puppet.conf, but in this version i dunno where is this set...

Concerning templatedir, that is a concept that was actually deprecated in Puppet 3.8. It did not carry over to Puppet 4.x.
You want to switch to directory environments where each module has its own stash of templates. It's not a good practice to use templates outside of modules.

Related

can't find curl-config on NixOS

I'm trying to install vim-now-haskell on NixOS 17.09.
The installation fails with the exception
*** Installer requires 'curl-config'. Please install and try again.
*** Aborting...
Unfortunately Search NixOS packages doesn't list any package for curl-config. It also isn't in installed curl-7.56.1.
I can hardly believe NixOS doesn't provide curl-config. Therefore I'm looking here for help to find it.
It's in the curl.dev output.
$ ls $(nix-build --no-out-link '<nixpkgs>' -A curl.dev)/bin
curl-config
The reason for this is to keep the closure size of anything the uses curl small. Normally Nixpkgs' stdenv.mkDerivation takes care of those details when processing the buildInputs attribute, but if you're not using Nixpkgs to build something you may have to do a bit more manual work.
Another way to get the curl-config command is nix-shell -p curl, which launches a shell that has the command in its environment.
[user#feb:~]$ nix-shell -p curl
[nix-shell:~]$ curl-config --version
libcurl 7.65.3
[nix-shell:~]$ exit
[user#feb:~]$
NixPkgs also has a curlFull package which has more features enabled, as can be seen by the number of packages in the closure of the runtime library output:
$ nix-store -q --requisites $(nix-build --no-out-link '<nixpkgs>' -A curl.out) | wc -l
6
$ nix-store -q --requisites $(nix-build --no-out-link '<nixpkgs>' -A curlFull.out) | wc -l
29
So for a more capable build of curl, use curlFull.dev.

How can I check if ncurses is installed?

How can I check if ncurses is installed in a Red-Hat Linux OS? One solution is to use
dpkg -l '*ncurses*' | grep '^ii'
But I don't even have the dpkg package in my system, and since I don't have the administrative rights, I can't install it.
On RedHat based systems there is (mostly) no dpkg but you can use rpm -qa | grep ncurse
on mac:
prompt> ls -la /usr/include/ncurses.h
lrwxr-xr-x 1 root wheel 8 11 jul 14:24 /usr/include/ncurses.h -> curses.h
The second line being not empty, this means ncurses is installed.

Checking for installed package for bash

I need a script that will check whether packages are installed for apache2, mysql and php.
Example output:
apache2 .... ok
mysql .... ok
php ... not installed
Packages are not necessarily named the same on different distributions, and querying for their presence depends on the package manager in use.
Debian (dpkg):
dpkg-query -W -f='${Package}\n' apache2 mysql-server php5 2>/dev/null
Fedora (RPM):
rpm -q --qf '%{NAME}\n' httpd mysql-server php 2>/dev/null
Gentoo (Portage):
equery --quiet list www-servers/apache:2 dev-lang/php dev-db/mysql
Assuming APT:
dpkg -l | grep -i apache2
etc.
For CentOS (will only show the ones that are installed):
yum list installed | egrep -i 'apache|mysql|php'

Which user is running the tomcat on Amazon EC2?

I have a Tomcat 7 server running on Amazon EC2 (OS - Ubuntu 12 LTS). How can I find out which user is running Tomcat on Amazon EC2?
Try this command:
ps auxwww | grep tomcat | grep -v grep
you will get output like this
$ ps auxwww | grep tomcat | grep -v grep
root 1941 0.2 1.7 419224 35208 ? Sl Aug12 0:06 /usr/lib/jvm/java-6-sun/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat/endorsed -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
there you get the process owner name and process id..

How can I find the version of the Fedora I use?

sudo find /etc | xargs grep -i fedora > searchFedora
gives:
/etc/netplug.d/netplug: # At least on Fedora Core 1
...
But see the Fedora version in the /etc/netplug.d/netplug file. Is it serious?
cat /etc/issue
Or cat /etc/fedora-release as suggested by #Bruce ONeel
You can also try /etc/redhat-release or /etc/fedora-release:
cat /etc/fedora-release
Fedora release 7 (Moonshine)
The proposed standard file is /etc/os-release. See http://www.freedesktop.org/software/systemd/man/os-release.html
You can execute something like:
$ source /etc/os-release
$ echo $ID
fedora
$ echo $VERSION_ID
17
$ echo $VERSION
17 (Beefy Miracle)
The simplest command which can give you what you need but some other good info too is:
hostnamectl
You could try
lsb_release -a
which works on at least Debian and Ubuntu (and since it's LSB, it should surely be on most of the other mainstream distros at least). http://rpmfind.net/linux/RPM/sourceforge/l/ls/lsb/lsb_release-1.0-1.i386.html suggests it's been around quite a while.
cat /etc/*release
It's universal for almost any major distribution.
[Belmiro#HP-550 ~]$ uname -a
Linux HP-550 2.6.30.10-105.2.23.fc11.x86_64 #1 SMP Thu Feb 11 07:06:34 UTC 2010
x86_64 x86_64 x86_64 GNU/Linux
[Belmiro#HP-550 ~]$ lsb_release -a
LSB Version: :core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:deskt
op-3.1-amd64:desktop-3.1-noarch:desktop-3.2-amd64:desktop-3.2-noarch
Distributor ID: Fedora
Description: Fedora release 11 (Leonidas)
Release: 11
Codename: Leonidas
[Belmiro#HP-550 ~]$
These commands worked for Artik 10 :
cat /etc/fedora-release
cat /etc/issue
hostnamectl
and these others didn't :
lsb_release -a
uname -a
What about uname -a ?
On my installation of Fedora 25 (workstation) all of the distribution ID info was found in this file:
/usr/lib/os.release.d/os-release-workstation
This included,
NAME=Fedora
VERSION="25 (Workstation Edition)"
ID=fedora
VERSION_ID=25
PRETTY_NAME="Fedora 25 (Workstation Edition)"
<...>
VARIANT="Workstation Edition"
VARIANT_ID=workstation
You can simply run this command to get the version number:
rpm -E %fedora
output:
uname -a works with my fc11
use commmand , screenfetch
output format info.

Resources