Skip to content

Instantly share code, notes, and snippets.

@VinceMacBuche
VinceMacBuche / gist:b08afdd7c845571e6a4c6d9050fc1885
Created July 13, 2016 17:15
vagrant issue centos7 hostname
INFO global: Vagrant version: 1.8.4
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_LOGNAME="tests"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_OLD_ENV_SUDO_USER="vmembre"
INFO global: VAGRANT_OLD_ENV_PYTHONPATH="/home/tests/rudder-api-client/lib.python:"
INFO global: VAGRANT_OLD_ENV_MANPATH="/usr/local/man:/usr/local/share/man:/usr/share/man:/opt/rudder/share/man"
INFO global: VAGRANT_OLD_ENV_TERM="xterm-256color"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/gems/vagrant-1.8.4/bin/vagrant"
@VinceMacBuche
VinceMacBuche / gist:1cd120397c642e0a70f7
Created January 5, 2016 09:22
/etc/httpd/conf.d/ncf-builder.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
LogLevel debug
DocumentRoot /dev/null
# Rudder webapp
RewriteEngine on
RewriteRule ^/$ /rudder [R]
ProxyPass "/ncf" "http://localhost:5000"
@VinceMacBuche
VinceMacBuche / gist:3788cbd920e00c6d886c
Created December 4, 2015 16:32
Logs node acceptance
[2015-12-04 16:17:42] TRACE com.normation.rudder.services.nodes.NodeInfoServiceCachedImpl - Cache check for node info gave 'true' (0 entry returned)
[2015-12-04 16:17:42] DEBUG com.normation.rudder.services.nodes.NodeInfoServiceCachedImpl - NodeInfo cache is up to date, last modification time: '2015-12-04T16:16:53.000Z'
[2015-12-04 16:17:42] TRACE com.normation.rudder.services.nodes.NodeInfoServiceCachedImpl - Cache check for node info gave 'true' (0 entry returned)
[2015-12-04 16:17:42] DEBUG com.normation.rudder.services.nodes.NodeInfoServiceCachedImpl - NodeInfo cache is up to date, last modification time: '2015-12-04T16:16:53.000Z'
[2015-12-04 16:17:42] TRACE com.normation.rudder.services.nodes.NodeInfoServiceCachedImpl - Cache check for node info gave 'true' (0 entry returned)
[2015-12-04 16:17:42] DEBUG com.normation.rudder.services.nodes.NodeInfoServiceCachedImpl - NodeInfo cache is up to date, last modification time: '2015-12-04T16:16:53.000Z'
[2015-12-04 16:17:42] TRACE com.normation.rudder.services.
ns=$(ps -h -o utsns --pid $$ 2>/dev/null)
if [ -e "/proc/bc/0" ]; then # we have openvz
if [ -e /bin/vzps ]; then # we have vzps
PS_COMAND="/bin/vzps -E 0"
else # use rudder provided vzps
PS_COMMAND="/opt/rudder/bin/vzps.py -E 0"
fi
elif [ -n "${ns}" ]; then # we have namespaces
PS_COMMAND="eval ps -h -e -O utsns | grep -E '^[[:space:]]*[[:digit:]]*[[:space:]]+${ns}'"
else # standard unix
@VinceMacBuche
VinceMacBuche / a-guide-to-ncf-api.txt
Last active September 11, 2015 12:53
Api ncf-builder
How to get techniques from a ncf api
You actually need the jsessionid cookie from your navigator (log in to Rudder and inspect your cookie), I will add authentication via rudder api token very soon
curl 'https://server.rudder/ncf/api/techniques?path=/var/rudder/configuration-repository/ncf' -k --cookie "JSESSIONID=Valueofyourcookie"
To send a technique to a server (see file api.json for exact content):
curl -X PUT 'https://server.rudder/ncf/api/techniques' -k --cookie "JSESSIONID=cookie" -d @api.json -v -H "Content-Type: application/json"
cd /var/lib/dpkg/info
# replace rudder-reports postinst
wget https://raw.githubusercontent.com/Normation/rudder-packages/branches/rudder/3.0/rudder-reports/debian/postinst -O rudder-reports.postinst
# Relaunch installation process
apt-get -f install
% ~/rudder-tools/scripts/rudder-dev/rudder-dev merge all [0.32 0.42 - 18% 0%]
Checkouting branches/rudder/2.10
$ git checkout branches/rudder/2.10
Basculement sur la branche 'branches/rudder/2.10'
Votre branche est à jour avec 'NRM/branches/rudder/2.10'.
Pulling on NRM/branches/rudder/2.10
$ git pull --ff-only
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 0), reused 0 (delta 0), pack-reused 0
rule.json:
{
"category": "8454a791-e0e1-4890-8e90-99dc2fefad70",
"displayName": "api_rule",
"shortDescription": "",
"longDescription": "",
"directives": [
"cc140542-e8c7-4e2c-b11d-fa320a7815af"
],
{
"category": "a6ad5d40-c411-4191-b286-a55114d68bc2",
"enabled": true,
"dynamic": false,
"nodeIds": [],
"query": {
"where": [
{
"value": "Linux",
"comparator": "eq",
@VinceMacBuche
VinceMacBuche / gist:5ee5f014f75b9586fed8
Created February 17, 2015 14:32
repair rpmPackageInstall
cd /var/rudder/configuration-repository/techniques/applications/rpmPackageInstallation/7.0
rm rpmPackageInstallation.st
wget https://raw.githubusercontent.com/VinceMacBuche/rudder-techniques/e4cb2794a084b5fec6d372fe859c83fa7fae36dd/techniques/applications/rpmPackageInstallation/7.0/rpmPackageInstallation.st
git add rpmPackageInstallation.st
git commit -m "Fix bug #6273"
curl -s -f -k "https://localhost/rudder/api/techniqueLibrary/reload"