graphite puppet error while installation - ruby

Getting the below error while installing graphite server using puppet
The pupet module installed for graphite
puppet module install dwerder-graphite
This is the content of graphite.pp
cat graphite.pp
The output
class {'graphite':
}
This the Command
puppet apply graphite.pp
The error what i received:
warning: Scope(Class[Graphite::Params]): Could not look up qualified variable 'graphite::gr_web_group'; class graphite has not been evaluated at /etc/puppet/modules/graphite/manifests/params.pp:97
warning: Scope(Class[Graphite::Params]): Could not look up qualified variable 'graphite::gr_web_group'; class graphite has not been evaluated at /etc/puppet/modules/graphite/manifests/params.pp:97
warning: Scope(Class[Graphite::Params]): Could not look up qualified variable 'graphite::gr_web_user'; class graphite has not been evaluated at /etc/puppet/modules/graphite/manifests/params.pp:103
warning: Scope(Class[Graphite::Params]): Could not look up qualified variable 'graphite::gr_web_user'; class graphite has not been evaluated at /etc/puppet/modules/graphite/manifests/params.pp:103
Failed to parse template graphite/opt/graphite/conf/carbon.conf.erb:
Filepath: /usr/lib/ruby/site_ruby/1.8/puppet/parser/scope.rb
Line: 459
Detail: undefined method `[]' for #<Puppet::Parser::Scope:0x7f82caef1e98>
at /etc/puppet/modules/graphite/manifests/config.pp:171 on node test
I'm running on RHEL
cat /etc/redhat-release
Red Hat Enterprise Linux Workstation release 6.4 (Santiago)

Where do you put file graphite.pp? Here is way to test the modules recommend by Puppetlabs.
If you puppet modules is /etc/puppet/modules, then create tests folder under it, and create graphite.pp, then add content in it:
include graphite
When you manually apply the change, run this command:
cd /etc/puppet/modules/tests
puppet apply --modulepath=/etc/puppet/modules graphite.pp

Related

Running my revel application on windows 10 fail

I had problem when run my revel app on windows
it create fine but don't run when I try so only get this. any idea?
C:\Desarrollo\Web\webpro>revel run -a webpro
Revel executing: run a Revel application
WARN 05:53:33 harness.go:175: No http.addr specified in the app.conf listening on localhost interface only. This will not allow external access to your application
Changed detected, recompiling
Parsing packages, (may require download if not cached)... Completed
ERROR 05:53:38 build.go:406: Build errors errors="C:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\memcached.go:11:2: no required module provides package github.com/bradfitz/gomemcache/memcache; to add it:\n\tgo get github.com/bradfitz/gomemcache/memcache\nC:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\redis.go:10:2: no required module provides package github.com/garyburd/redigo/redis; to add it:\n\tgo get github.com/garyburd/redigo/redis\nC:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\inmemory.go:12:2: no required module provides package github.com/patrickmn/go-cache; to add it:\n\tgo get github.com/patrickmn/go-cache\n"
C:\Users\Mario\go\src\webpro\C:\Users\Mario\go\pkg\mod\github.com\revel\revel#v1.0.0\cache\memcached.go:11
WARN 05:53:38 build.go:420: Could not find in GO path file=C:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\memcached.go:11
ERROR 05:53:38 harness.go:239: Build detected an error error="Go Compilation Error (in C:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\memcached.go:11:2): no required module provides package github.com/bradfitz/gomemcache/memcache; to add it:"
Error compiling code, to view error details see proxy running on http://:9000
Time to recompile 5.3684655s
I am newer ok
Best
Check your IPv4 address with the ipconfig command
Open webpro/conf/app.conf and paste the IPv4 address into the http.addr parameter

unable to resolve class org.yaml.snakeyaml.Yaml #Grab('org.yaml:snakeyaml:1.17') Jenkins pipeline

I am unable to use #Grab in Jenkins pipeline. Need help here. following is the error.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 1: unable to resolve class org.yaml.snakeyaml.Yaml
# line 1, column 1.
#Grab('org.yaml:snakeyaml:1.17')
^
1 error
Following is the pipeline code
test.groovy
#Grab('org.yaml:snakeyaml:1.17')
import org.yaml.snakeyaml.Yaml
node{
stage('test'){
Yaml parser = new Yaml()
def a = """
---
environment: production
classes:
nfs::server:
exports:
- /srv/share1
- /srv/share3
parameters:"""
parser.load(a)
print(parser.load(a))
}
}
The error occurs in pipeline with definition "Pipeline script from SCM" and works fine with definition "pipeline script" and Script console
Following code works with Script Console (Manage Jenkins -> Script console)
#Grab('org.yaml:snakeyaml:1.17')
import org.yaml.snakeyaml.Yaml
Yaml parser = new Yaml()
def a = """
---
environment: production
classes:
nfs::server:
exports:
- /srv/share1
- /srv/share3
parameters:"""
parser.load(a)
print(parser.load(a))
output
[environment:production, classes:[nfs::server:[exports:[/srv/share1, /srv/share3]]], parameters:null]
Groovy Grab uses Ivy to manage the recovery of jars. You need to add Shared Groovy Libraries Plugin. By default, it gets jars from maven central, but you can specify other repositories with the annotation #GrabResolver. Taken from here
Also, you can add jar file to ./.groovy/grapes/org.yaml/snakeyaml/jars/snakeyaml-1.17.jar in you Jenkins Home directory.
And the second case does not use this library and use standard readYaml writeYaml functions from Pipeline Utility Steps

Chef: Why am I not reading in the attribute value I just set?

I am getting my toes wet with chef at my job and have been tasked with installing making a recipe to install telegraf on our machines with custom configs. Let me also preface this with I have no ruby experience.
Before downloading or installing telegraf I want to verify that the if telegraf exists to only do all the following work if the versions miss match.
So I have attempted to set an attribute during the recipe runtime that other resources will check against.
ruby_block 'get telegraf version' do
block do
#tricky way to load this Chef::Mixin::ShellOut utilities
Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut)
command = 'C:\\Program Files\\telegraf\\telegraf.exe --version'
command_out = shell_out(command)
node.default['windows']['telegraf']['installed_version'] = 'good'
end
notifies :write, 'log[log_version]', :delayed
action :run
only_if { ::File.exists?('C:\\Program Files\\telegraf\\telegraf.exe')}
end
log 'log_version' do
message node['windows']['telegraf']['installed_version']
level :error
end
When I look at the output though I see
* ruby_block[get telegraf version] action run[2018-07-23T14:48:11-07:00] INFO: Processing ruby_block[get telegraf version] action run (win-telegraf::telegraf line 26)
[2018-07-23T14:48:11-07:00] INFO: ruby_block[get telegraf version] called
- execute the ruby block get telegraf version
* log[log_version] action write[2018-07-23T14:48:11-07:00] INFO: Processing log[log_version] action write (win-telegraf::telegraf line 39)
[2018-07-23T14:48:11-07:00] ERROR:
So why is it when I read node['windows']['telegraf']['installed_version'] that the log prints nothing instead of 'good'?
Chef uses a two-pass loading system, check out https://coderanger.net/two-pass/ for more details. But the tl;dr for this case is that the stuff inside block do ... end runs in the second phase, while the Ruby code for the log resource is evaluated in the first phase. In general you can fix this using the lazy{} helper, but in this case what you probably want is either a custom resource or an Ohai plugin. For "normal" Windows applications, this is all handled by the MSI subsystem and the windows_package resource, but as Telegraf doesn't offer MSI packages you are a bit out of luck. That said, there are packages available for Chocolatey (a Windows packaging system like Mac's Homebrew) so you might want to look into using that instead of writing this yourself.

Could not autoload puppet/type/dism Error on running puppet script

Puppet Agent - 64 bit v4.0.0
OS- Windows Server R2 64 bit
I am trying to install IIS by using DISM module (https://forge.puppetlabs.com/puppetlabs/dism) from Puppet site.
I am trying to run the following script. Im sure it is correct.
dism {
'IIS-WebServerRole': ensure => present,
}
dism {
'IIS-WebServer': ensure => present,
}
The module is correctly installed and I have tried re-installing it several times but I get the the error mentioned below repeatedly. How do I resolve this ?
Im using Puppet
C:\Program Files\Puppet Labs\Puppet\bin>puppet apply IIS_Install.pp
Error: Could not autoload puppet/type/dism: Attempt to redefine method set_present with block
Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/dism: Attempt to redefine method set_pesent with block at C:/Program Files/Puppet Labs/Puppet/bin/IIS_Install.pp:2:3 on node win-i73ju1hai2q.localdomain
Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/dism: Attempt to redefine method set_pesent with block at C:/Program Files/Puppet Labs/Puppet/bin/IIS_Install.pp:2:3 on node win-i73ju1hai2q.localdomain
Try ensure => 'present'
The error isn't very helpful, but I think it might be Puppet v4 and how the parser is different and more strict.
If that doesn't work, make sure that you should be using ensure at all. Not all resources are ensurable.

Unrecognized option: --spring.profiles.active=prod Openshift

When i deployed jhipster web application to OpenShift, my app page getting "503 Service Temporarily Unavailable" and when I look at the log files, having the following problem;
==> app-root/logs/mapp.log <==
Unrecognized option: --spring.profiles.active=prod
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Is there any solution you know?
That is not an option recognized by the JVM. In order to set system properties use use -D. From the Java 7 reference:
-Dproperty=value
Sets a system property value.
If value is a string that contains spaces, then you must enclose the
string in double quotation marks:
java -Dmydir="some string" SomeClass
In this instance you would use:
-Dspring.profiles.active=prod
It can then be acquired in your application by using the System class:
System.getProperty("spring.profiles.active")

Resources