Running puppet apply using master for dependencies - testing

I wish to be able to modify modules locally before commit to source control.
I believe I need to use puppet apply.
I create a init.pp test file including my module and add --modulepath directing to my module directory.
My problem is that all my dependencies exists on the puppet master and I don't want to download all dependencies. I want to have the version exists on the master.
Is there a way to do it?

I would split my tree into environments: test and productions, or something similar.
In my case I a more "complex" but smart method!
I do have a git repo, and i do have it in 2 places
/etc/puppet
/home/myuser/puppet-main
Both places are an environment,
Puppet.conf:
[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
factpath = $vardir/lib/facter
environmentpath = $confdir/environments
basemodulepath = /usr/share/puppet/modules
environment_timeout = 30s
The /etc/puppet directory tree:
.
./environments
./environments/example_env
./environments/example_env/modules
./environments/example_env/manifests
./environments/billias
./environments/production
./environments/production/modules
./environments/production/manifests
./environments/production/hieradata
./modules
./manifests
Then my /etc/puppet/environments/production/environment.conf
environment_timeout = 30s
modulepath = modules/platform:modules/config:modules/main:$basemodulepath
The last but not least my /etc/puppet/environments/billias (my personal env) has symlink to the directories/files of production, but the one copied into my personal home dir:
lrwxrwxrwx 1 root root 52 Dec 22 19:04 environment.conf -> /etc/puppet/environments/production/environment.conf
lrwxrwxrwx. 1 root root 60 Nov 28 22:31 hieradata -> /home/billias/puppet-main/environments/production/hieradata/
lrwxrwxrwx. 1 root root 60 Nov 28 22:31 manifests -> /home/billias/puppet-main/environments/production/manifests/
lrwxrwxrwx. 1 root root 58 Nov 28 22:31 modules -> /home/billias/puppet-main/environments/production/modules/
Last but not least, this way i can write code on my /home/billias/puppet-main/environments/production/ and commit it on my git after i finish with it...
i can test the code before pushing it by:
puppet agent -t --environment=billias
If you have questions, do not hesitate to ask.

Related

IntelliJ claims to build but jar files are not touched

I have a java project that builds correctly using mvn
># mvn package
[ok]
># ls -il target/app.java target/app/ap.jar target/docker-app/app.jar
4239421 -rw-r--r-- 1 me domain users 25305467 Apr 27 08:55 target/docker-app/app.jar
4239422 -rw-r--r-- 1 me domain users 25305467 Apr 27 08:55 target/app/app.jar
4239416 -rw-r--r-- 1 me domain users 25305467 Apr 27 08:55 target/app.jar
change sources, build it again and the mtimes change
># mvn package
[ok]
># ls -il target/app.java target/app/ap.jar target/docker-app/app.jar
4239421 -rw-r--r-- 1 me domain users 25305467 Apr 27 08:56 target/docker-app/app.jar
4239422 -rw-r--r-- 1 me domain users 25305467 Apr 27 08:56 target/app/app.jar
4239416 -rw-r--r-- 1 me domain users 25305467 Apr 27 08:56 target/app.jar
as expected. Also if I diff one of these jar files with a copy of an older one, it is different.
I import this project into IntelliJ IDEA and build
Build completed successfully with 3 warnings
however
># ls -il target/app.java target/app/ap.jar target/docker-app/app.jar
4239421 -rw-r--r-- 1 me domain users 25305467 Apr 27 08:56 target/docker-app/app.jar
4239422 -rw-r--r-- 1 me domain users 25305467 Apr 27 08:56 target/app/app.jar
4239416 -rw-r--r-- 1 me domain users 25305467 Apr 27 08:56 target/app.jar
the mtime has NOT changed, and diff reports that the files are identical to copies of the earlier versions.
Why is IDEA not producing new jar files?
Your question is very similar to this one, which I have already answered: intellj IDEA doesnt build jar properly
It helps understanding.
Well looked at the catches. (click zoom)
This uses nvmw local to the project, nothing prevents you from using your nvm version.
Namely intellij provided well, its own build construction system, to create jars without maven. (Even though I personally have not been able to set it up correctly for it to work for starting the application.)
But if you are looking to create a war, I can give you more information to create a war file ...
I use spring boot but the principle remains the same with all simple java projects

Moving file on WEBDAV server returns 404 even though file exists

I can't move specific files on our server via webdav forth and back and can't find the source of the issue. Some examples:
Works: README.md -> README1.md -> README.md
Works: db.xml.gz -> db.xml.bla -> db.xml.gz
Doesn't work: db.xml.gz -> db.xml.gz.lock -> db.xml.gz (results in 404)
Tried it with cadaver:
dav:/webdav/User/> ls
Listing collection `/webdav/User/': succeeded.
.htaccess 117 Jun 6 2018
db.xml.gz 635 Feb 7 21:36
dav:/webdav/User/> mv db.xml.gz db.xml.gz.lock
Moving `/webdav/User/db.xml.gz' to `/webdav/User/db.xml.gz.lock': succeeded.
dav:/webdav/User/> mv db.xml.gz.lock db.xml.gz
Moving `/webdav/User/db.xml.gz.lock' to `/webdav/User/db.xml.gz': failed:
404 Not Found
dav:/webdav/User/> ls
Listing collection `/webdav/User/': succeeded.
.htaccess 117 Jun 6 2018
db.xml.gz.lock 635 Feb 7 21:36
dav:/webdav/User/> mv db.xml.gz.lock db.xml
Moving `/webdav/User/db.xml.gz.lock' to `/webdav/User/db.xml': failed:
404 Not Found
dav:/webdav/User/> mv db.xml.gz.lock db.bla
Moving `/webdav/User/db.xml.gz.lock' to `/webdav/User/db.bla': succeeded.
dav:/webdav/User/> mv db.bla db.blubb
Moving `/webdav/User/db.bla' to `/webdav/User/db.blubb': succeeded.
dav:/webdav/User/> mv db.blubb db.bla
Moving `/webdav/User/db.blubb' to `/webdav/User/db.bla': succeeded.
It seems to fail if the source is the same as the target plus additional file endings. I read that some windows servers skip the file ending which causes issues, but this is a Linux machine.
Any ideas highly appreciated!
I found this bug report with the solution: Disabling MultiViews in the apache host configuration fixed the issue. MultiViews was preventing me basically from renaming some file extensions.

How to define the lua module path in nifi Processor ExecuteScript?

I am new to Lua.
Several days ago, I complished using python in ExecuteScript of NIFI. I set Python Module path to /usr/local/lib/python2.7/dist-packages. Everything goes well.
But doing the same thing with Lua is so difficult for me. Always Error of cannot find the Module!!!
I use Luarock to install modules.
Could you please tell me how to set the lua module path or some useful infomation about it?
Here comes some info of my Luarocks setting:
lbh#es-2:~/install/nifi-1.1.1/lua_modules$ luarocks list
Installed rocks:
----------------
lua-cjson
2.1.0-1 (installed) - /usr/local/lib/luarocks/rocks
luasocket
3.0rc1-2 (installed) - /usr/local/lib/luarocks/rocks
redis-lua
2.0.4-1 (installed) - /usr/local/lib/luarocks/rocks
An example of lua-cjson.
lbh#es-2:~/install/nifi-1.1.1/lua_modules$ luarocks show lua-cjson
lua-cjson 2.1.0-1 - A fast JSON encoding/parsing module
The Lua CJSON module provides JSON support for Lua. It features: - Fast,
standards compliant encoding/parsing routines - Full support for JSON with
UTF-8, including decoding surrogate pairs - Optional run-time support for
common exceptions to the JSON specification (infinity, NaN,..) - No
dependencies on other libraries
License: MIT
Homepage: http://www.kyne.com.au/~mark/software/lua-cjson.php
Installed in: /usr/local
Modules:
cjson
lua2json
json2lua
cjson.util
Directory info of /usr/local/lib/luarocks/rocks
lbh#es-2:~/install/nifi-1.1.1/lua_modules$ ls -l /usr/local/lib/luarocks/rocks
total 16
drwxr-xr-x 3 root root 4096 Mar 17 11:13 lua-cjson
drwxr-xr-x 3 root root 4096 Mar 17 11:18 luasocket
-rw-r--r-- 1 root root 3653 Mar 17 11:18 manifest
drwxr-xr-x 3 root root 4096 Mar 17 11:18 redis-lua

libcurl Invalid ELF header in new Arch Install

So I just installed Arch and most things are working fine, but when I try to use pacman or curl, I get the error:
pacman: error while loading shared libraries: /usr/lib/libcurl.so.4: invalid ELF header
Also, I can't seem to run anything pacman-related for now... not even a pacman --help
Not sure if useful, but ls -l /usr/lib | grep libcurl gives:
-rw-r--r-- 1 root root 594016 Jun 22 12:21 libcurl.a
lrwxrwxrwx 1 root root 16 Jun 22 12:21 libcurl.so -> libcurl.so.4.3.0
lrwxrwxrwx 1 root root 16 Jun 22 12:21 libcurl.so.4 -> libcurl.so.4.3.0
-rwxr-xr-x 1 root root 408324 Jun 22 12:21 libcurl.s0.4.3.0
Thanks in advance!
Update: running ./curl-config gives the error, "cannot execute binary file". This makes me wonder if maybe I have a 64 bit version, whilst I'm running Arch i686. What is the best way to handle this?
maybe I have a 64 bit version, whilst I'm running Arch i686
That would do it. Run file ./curl-config. If it says ELF 64-bit LSB executable,... reinstall curl from correct packages.

keyctl commands throw 'undefined symbol: dlopen' errors

I am running Centos 5.8 on a production server. I have an application that needs to use the keyctl command, but everytime the app calls (or I call) the command, I have some errors.
The first error was this:
root#server [~] keyctl show
segmentation fault
Then, I re-installed the keyutils binaries using yum. These are the keyutils packages I have on the server:
root#server [~]# rpm -qa | grep keyutils
keyutils-libs-1.2-1.el5
keyutils-libs-1.2-1.el5
keyutils-1.2-1.el5
keyutils-libs-devel-1.2-1.el5
And now, I have another different error:
root#server [~]# keyctl show
keyctl: symbol lookup error: /lib64/libkeyutils.so.1: undefined symbol: dlopen
I checked the libraries of keyctl, and libdl is not there.
root#server [~]# ldd /bin/keyctl
linux-vdso.so.1 => (0x00007fffcc5fd000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00000033df000000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d7ae00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d7aa00000)
All libraries that uses are fine.
root#server [~]# ls -al /lib64/libkeyutils*
-rwxr-xr-x 1 root root 9472 Jan 6 2007 /lib64/libkeyutils-1.2.so*
lrwxrwxrwx 1 root root 18 Nov 21 07:56 /lib64/libkeyutils.so.1 -> libkeyutils.so.1.9*
-rwxr-xr-x 1 root root 34584 Jan 6 2007 /lib64/libkeyutils.so.1.9*
root#server [~]# ls -al /lib64/libdl*
-rwxr-xr-x 1 root root 23360 Aug 27 08:59 /lib64/libdl-2.5.so*
lrwxrwxrwx 1 root root 12 Nov 16 02:01 /lib64/libdl.so.2 -> libdl-2.5.so*
root#server [~]#
Have you ever seen this problem before? I tried run the same version on others distros and it works.
I would like to re-install this server, but I can't because it is a production server.
Is there a way I can add or link a shared library to a binary already linked to others .so libraries?
Look at: http://blog.solidshellsecurity.com/2013/02/08/sshd-spam-rootkit-lib64libkeyutils-so-1-9/
It appears that there is no such legitimate file as libkeyutils.so.1.9
It is a rootkit, the latest legitimate version of this library is libkeyutils.so.1.3 on CentOS 6.3 (final).
rm -f /lib64/libkeyutils.so.1.9
ldconfig
/etc/init.d/sshd restart
There's also a suspected (as of now) unpatched user escalation priviledge flaw in all CentOS and RedHat kernels: https://access.redhat.com/security/cve/CVE-2013-0871 and http://blog.configserver.com/index.php?itemid=716
You may also need to reinstall SSH:
https://serverfault.com/questions/476954/remove-shared-library-from-sshd
https://forums.cpanel.net/f185/sshd-rootkit-323962.html
LD_PRELOAD=/lib64/libdl-2.5.so keyctl show