- From: Tensibai Zhaoying <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook
- Date: Sat, 11 Jul 2015 00:04:22 +0200
First of all, forget about back slashes, use forward slashes (unless in
Windows script context like bat cmd and powershell)
Secondly, you should really make an effort reading, I gave you clues and
links.
Last try: have a mount resource (I'm pretty sure everyone permission is only
on share and not on the NTFS permissions, you should learn about this too)
and give file://mount_target/package.rpm to your splunk_installer ressource
attribute.
Le 10 juil. 2015 22:52, o haya
<
>
a écrit :
>
>
Hi,
>
>
I don't understand what you're suggesting?
>
>
Remember, that I'm talking about if it's possible to do this with an
>
already-existing cookbook/recipe, the chef-splunk cookbook.
>
>
Also, BTW, I was looking at that cookbook, and it looks like that has a
>
"definitions/splunk_installer.rb" that has:
>
>
define :splunk_installer, :url => nil do
>
cache_dir = Chef::Config[:file_cache_path]
>
package_file = splunk_file(params[:url])
>
cached_package = ::File.join(cache_dir, package_file)
>
>
remote_file cached_package do
>
source params[:url]
>
action :create_if_missing
>
end
>
.
>
.
>
.
>
etc
>
.
>
.
>
>
so it seems like that code is already using a remote_file type resource.
>
>
And, according to this:
>
>
https://docs.chef.io/resource_remote_file.html
>
>
>
The 'source' is defined as:
>
>
"Required. The location of the source file. The location of the source file
>
may be HTTP (http://), FTP (ftp://), local (file:///), or UNC
>
(\\\\host\\share\\file.tar.gz)."
>
>
>
i.e., the Chef docs explicitly say that a UNC should be all right?
>
>
So it seems like it SHOULD take an UNC in the "url" parameter, but then why
>
do I get an error saying it's not a URL when I use a UNC (and yes, I have
>
tried with both the double-back-slashes as well as the
>
quadruple-back-slashes)?
>
>
>
Thanks,
>
Jim
>
>
>
>
>
--------------------------------------------
>
On Fri, 7/10/15, Tensibai Zhaoying
>
<
>
>
wrote:
>
>
Subject: [chef] Re: Re: Re: Using UNC path was Re: Re: Re: Re: A question
>
about chef-splunk cookbook
>
To:
>
>
>
Date: Friday, July 10, 2015, 3:06 PM
>
>
That's what I meant
>
by the session, if an UNC path does not work, use local
>
filesystem in the cookbook instead of targeting the UNC
>
path.
>
>
Pseudo code:
>
Mount '/mnt/target' do
>
Source '//server/share'
>
End
>
>
Remote_file
>
'/usr/local/src/package.rpm'
>
>
Source '/mnt/target/package.rpm'
>
End
>
>
Package
>
'/usr/local/src/package.rpm'
>
>
Mount '/mnt/target' do
>
Action :unmount
>
End
>
>
Writen on phone and by memory,
>
no guarantee a copy paste will work but I hope it gives the
>
idea.
>
>
>
>
>
>
Le 10 juil. 2015 20:22, o
>
haya
>
<
>
>
a
>
écrit :
>
>
>
> Hi,
>
>
>
> The share was
>
configured with permissions for "Everyone", so I
>
can see the share without any credentials.
>
>
>
> So, for example, when
>
I did the mount to /mnt/shareit, I could do "ls
>
/mnt/shareit" and see the RPM files there.
>
>
>
> For the test where I
>
used the mount, I:
>
>
>
> - Did "mount"
>
> - executed "chef-client -o
>
'recipe[chef-splunk::install_server]'
>
>
>
> And I got the error.
>
>
>
>
> Jim
>
>
>
>
>
>
>
>
>
--------------------------------------------
>
> On Fri, 7/10/15, Tensibai Zhaoying
>
> <
>
>
>
>
wrote:
>
>
>
> Subject:
>
[chef] Re: Using UNC path was Re: Re: Re: Re: A question
>
about chef-splunk cookbook
>
> To:
>
>
>
>
>
>
> Date: Friday, July 10, 2015, 1:43 PM
>
>
>
>
> Usually if the
>
share need
>
> credentials the path is to
>
mount the share, remote_file with
>
>
>
local path to the mounted share as source and then
>
> unmount.
>
>
>
> Is this what you
>
>
>
tried ? On Linux, unlike Windows the share access rights are
>
>
> not stored in the user session
>
>
>
> Le 10 juil. 2015
>
18:12, o haya
>
<
>
>
a
>
>
> écrit :
>
> >
>
>
> > Hi,
>
> >
>
>
> > Sorry it's taken
>
> so long to try this, but so far, I
>
haven't been able to
>
> make it work:
>
>
> >
>
> >
>
> > splunk]#
>
>
> chef-client -o
>
'recipe[chef-splunk::install_server]'
>
>
>
> > Starting Chef
>
Client, version 12.4.0
>
>
>
> > [2015-07-10T12:05:52-04:00] WARN: Run
>
>
> List override has been provided.
>
> >
>
>
>
[2015-07-10T12:05:52-04:00] WARN: Original Run List: []
>
> > [2015-07-10T12:05:52-04:00] WARN:
>
> Overridden Run List:
>
[recipe[chef-splunk::install_server]]
>
>
>
> > resolving
>
cookbooks for run list:
>
>
>
["chef-splunk::install_server"]
>
> > Synchronizing Cookbooks:
>
> > - chef-vault
>
>
>
> -
>
> chef-splunk
>
> > Compiling Cookbooks...
>
> > Converging 2 resources
>
> > Recipe: chef-splunk::install_server
>
>
> > *
>
>
>
remote_file[/var/chef/cache/splunk-6.0.7-241889-linux-2.6-x86_64.rpm]
>
>
> action
>
create_if_missing[2015-07-10T12:05:52-04:00] WARN:
>
>
>
remote_file[/var/chef/cache/splunk-6.0.7-241889-linux-2.6-x86_64.rpm]
>
>
> cannot be downloaded from
>
>
>
file://192.168.0.236/h/INSTALL-FILES-CENTOS6-and-CHEF/SPLUNK/splunk-6.0.7-241889-linux-2.6-x86_64.rpm:
>
>
>
> No such file or directory @ rb_sysopen
>
-
>
>
>
/h/INSTALL-FILES-CENTOS6-and-CHEF/SPLUNK/splunk-6.0.7-241889-linux-2.6-x86_64.rpm
>
>
>
>
>
> >
>
> >
>
> >
>
>
>
================================================================================
>
>
>
>
>
> > Error
>
executing action
>
> `create_if_missing`
>
on resource
>
>
>
'remote_file[/var/chef/cache/splunk-6.0.7-241889-linux-2.6-x86_64.rpm]'
>
>
>
>
> >
>
>
>
================================================================================
>
>
>
>
>
> >
>
> >
>
>
>
Errno::ENOENT
>
> >
>
-------------
>
> > No such file
>
or directory @
>
> rb_sysopen -
>
>
>
/h/INSTALL-FILES-CENTOS6-and-CHEF/SPLUNK/splunk-6.0.7-241889-linux-2.6-x86_64.rpm
>
>
>
>
>
> >
>
> > Resource
>
>
>
Declaration:
>
> >
>
> ---------------------
>
> > # In
>
>
>
/var/chef/cache/cookbooks/chef-splunk/definitions/splunk_installer.rb
>
>
>
>
> >
>
> > 26:
>
> remote_file cached_package do
>
> >
>
>
>
27: source params[:url]
>
> >
>
>
> 28: action
>
:create_if_missing
>
> >
>
29: end
>
> >
>
>
>
30:
>
> >
>
> >
>
> Compiled
>
Resource:
>
> >
>
> ------------------
>
>
>
> # Declared
>
> in
>
>
>
/var/chef/cache/cookbooks/chef-splunk/definitions/splunk_installer.rb:26:in
>
>
> `block in from_file'
>
> >
>
> >
>
>
>
remote_file("/var/chef/cache/splunk-6.0.7-241889-linux-2.6-x86_64.rpm")
>
>
> do
>
> >
>
params
>
>
>
{:url=>"file://192.168.0.236/h/INSTALL-FILES-CENTOS6-and-CHEF/SPLUNK/splunk-6.0.7-241889-linux-2.6-x86_64.rpm",
>
>
>
> :name=>"splunk"}
>
> >
>
>
>
provider Chef::Provider::RemoteFile
>
>
>
> action :create_if_missing
>
> > retries 0
>
> >
>
>
>
retry_delay 2
>
> >
>
> default_guard_interpreter :default
>
> >
>
> path
>
>
>
>
"/var/chef/cache/splunk-6.0.7-241889-linux-2.6-x86_64.rpm"
>
>
>
>
> >
>
backup 5
>
> > atomic_update
>
true
>
> > source
>
>
>
["file://192.168.0.236/h/INSTALL-FILES-CENTOS6-and-CHEF/SPLUNK/splunk-6.0.7-241889-linux-2.6-x86_64.rpm"]
>
>
>
>
>
> >
>
use_etag true
>
> >
>
use_last_modified true
>
> >
>
declared_type :remote_file
>
> >
>
cookbook_name
>
>
>
"chef-splunk"
>
> >
>
>
> recipe_name
>
"install_server"
>
> >
>
> end
>
> >
>
> >
>
> > Running
>
handlers:
>
> >
>
>
>
[2015-07-10T12:05:52-04:00] ERROR: Running exception
>
> handlers
>
> >
>
Running handlers complete
>
> >
>
[2015-07-10T12:05:52-04:00] ERROR:
>
>
>
Exception handlers complete
>
> > Chef
>
>
> Client failed. 0 resources updated in
>
1.425198167 seconds
>
>
>
> > [2015-07-10T12:05:52-04:00] FATAL:
>
>
> Stacktrace dumped to
>
/var/chef/cache/chef-stacktrace.out
>
>
>
> [2015-07-10T12:05:52-04:00] ERROR:
>
>
>
remote_file[/var/chef/cache/splunk-6.0.7-241889-linux-2.6-x86_64.rpm]
>
>
> (chef-splunk::install_server line 26)
>
had an error:
>
> Errno::ENOENT: No such
>
file or directory @ rb_sysopen -
>
>
>
/h/INSTALL-FILES-CENTOS6-and-CHEF/SPLUNK/splunk-6.0.7-241889-linux-2.6-x86_64.rpm
>
>
>
>
>
> >
>
[2015-07-10T12:05:52-04:00] FATAL:
>
>
>
Chef::Exceptions::ChildConvergeError: Chef run process
>
> exited unsuccessfully (exit code 1)
>
> >
>
>
>
> splunk]#
>
>
>
>
> >
>
> >
>
> > I've
>
tried it using both directly like
>
>
>
above using
>
>
>
"file://192.168.0.236/h/INSTALL-FILES-CENTOS6-and-CHEF/SPLUNK/splunk-6.0.7-241889-linux-2.6-x86_64.rpm"
>
>
>
> in the chef-splunk attributes, and
>
also tried creating a
>
> mount at
>
/mnt/shareit (and confirming I can see the RPMs at
>
> the mount) and get the same error.
>
> >
>
> > Is there
>
something else I need to do with
>
> the
>
file:// URL?
>
> >
>
> >
>
> Thanks,
>
> > Jim
>
> >
>
> >
>
> >
>
>
>
--------------------------------------------
>
> > On Tue, 7/7/15, Steven Murawski
>
<
>
>
>
>
> wrote:
>
> >
>
> > Subject:
>
> [chef]
>
Re: Re: Re: A question about chef-splunk cookbook
>
> > To:
>
> >
>
> >
>
>
>
>
> > Cc: "o
>
haya"
>
<
>
>
>
>
>
>
> > Date:
>
Tuesday, July 7, 2015, 6:14 PM
>
>
>
> >
>
> >
>
> >
>
>
>
>
>
> Also, as of 12.4.0,
>
> > remote_file can
>
>
>
use UNC paths!
>
> > Steve
>
> > Steven MurawskiCommunity Software
>
> Development Engineer @
>
> > ChefMicrosoft
>
>
>
MVP - PowerShell
>
> > http://stevenmurawski.com
>
> >
>
>
>
>
>
> On 7/7/2015 5:07:44
>
> > PM, o haya
>
> > <
>
>
> >
>
>
> wrote:Hi Tensibai,
>
> >
>
> >
>
> >
>
> >
>
> Thanks. I will give that a try as soon
>
as
>
> > I figure out another problem I
>
just
>
> started having (with
>
> > Chef and CENTOS).
>
>
>
> >
>
> >
>
> >
>
> > Jim
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
>
>
--------------------------------------------
>
> >
>
> > On Tue,
>
7/7/15,
>
> Tensibai Zhaoying wrote:
>
> >
>
> >
>
> >
>
> >
>
> Subject: [chef] Re: A question about
>
>
> > chef-splunk cookbook
>
> >
>
> > To:
>
> >
>
> >
>
>
>
>
> >
>
> > Date: Tuesday,
>
> July 7, 2015, 5:52 PM
>
> >
>
> >
>
> >
>
> > I
>
don't know for the
>
> >
>
> > slunk cookbook
>
> itself (didn't use it)
>
> > but
>
> assuming it
>
>
> >
>
> >
>
> takes advantage of remote_file resource
>
>
> > I'm sure yes as
>
> >
>
> > my sole
>
>
> contribution to chef was on the
>
> >
>
> file:// url
>
code and
>
> >
>
>
>
> I did test for this kind of path for
>
> Unix
>
> > and
>
Windows ;)
>
> >
>
>
>
>
>
> >
>
>
>
> T.l.;d.r Should be
>
> yes but may
>
>
> >
>
> >
>
> work with a UNC path
>
>
>
>
>
> file://server/share/file.rpm too
>
if the
>
> >
>
> >
>
share is browsable
>
> as anonymous
>
(everyone
>
> > read permission
>
> in
>
> >
>
> > share and
>
>
>
NTFS acl)
>
> >
>
>
>
>
>
> >
>
>
>
> Le 7
>
> >
>
> > juil. 2015 22:49,
>
> o haya a
>
> >
>
> >
>
> écrit :
>
>
> >
>
> >
>
>
>
>
>
> >
>
> > > Hi,
>
>
>
>
>
> > >
>
> >
>
> > >
>
I'm
>
> starting to
>
> >
>
> >
>
> look at using the chef-splunk cookbook:
>
>
> >
>
> >
>
>
>
> >
>
> >
>
>
>
> > https://github.com/chef-cookbooks/chef-splunk
>
>
>
>
> >
>
> >
>
> >
>
> > >
>
> >
>
>
> > > I'm not
>
>
>
> >
>
> > sure if there
>
> is somewhere else more
>
> > appropriate for
>
>
>
> >
>
> > questions, so
>
> I'm posting here.
>
> > Hopefully
>
>
>
that's
>
> >
>
>
>
> ok
>
> (otherwise please point me
>
to the
>
> >
>
>
>
correct place?)?
>
> >
>
> >
>
> >
>
> >
>
> > >
>
>
>
>
> >
>
> > >
>
> >
>
>
> > Anyway, the
>
> question I have is whether
>
> > this can
>
>
>
support
>
> >
>
>
>
> using
>
> file:// type URLs for
>
the location
>
> > of
>
> the Splunk
>
> >
>
> >
>
> server and
>
Splunk forwarder RPMs?
>
> >
>
> > >
>
> >
>
>
> > >
>
>
>
>
>
> > > If possible, we
>
would
>
> >
>
> >
>
like to setup a
>
> CIFs mount, say at
>
>
> > /mnt/splunk_rpms,
>
>
>
> >
>
> > pointing to a
>
> Windows share, and then use
>
> > something
>
> like
>
>
> >
>
> >
>
> >
>
>
>
"file:///mnt/splunk_rpms/the_splunkserver.rpm" in
>
>
>
>
> >
>
> > the
>
>
>
attribute.
>
> >
>
> >
>
> >
>
> >
>
> > >
>
>
> >
>
> >
>
Will something
>
> like that work?
>
> >
>
> >
>
> >
>
> >
>
> > >
>
> Thanks,
>
>
> >
>
> >
>
>
>
> Jim
>
> >
>
>
> > >
>
>
>
>
>
> >
>
>
>
>
>
> >
>
> >
>
>
>
>
>
>
>
>
> >
>
> >
>
>
>
>
>
>
>
> >
>
>
>
- [chef] A question about chef-splunk cookbook, o haya, 07/07/2015
- [chef] Re: A question about chef-splunk cookbook, Tensibai Zhaoying, 07/07/2015
- [chef] Re: Re: A question about chef-splunk cookbook, o haya, 07/07/2015
- [chef] Re: Re: Re: A question about chef-splunk cookbook, Steven Murawski, 07/07/2015
- [chef] Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook, o haya, 07/10/2015
- [chef] Re: Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook, Tensibai Zhaoying, 07/10/2015
- [chef] Re: Re: Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook, o haya, 07/10/2015
- [chef] Re: Re: Re: Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook, Tensibai Zhaoying, 07/10/2015
- [chef] Re: Re: Re: Re: Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook, o haya, 07/10/2015
- [chef] Re: Re: Re: Re: Re: Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook, Tensibai Zhaoying, 07/10/2015
- [chef] Re: Re: Re: Re: Re: Re: Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook, o haya, 07/10/2015
- [chef] Working I think was Re: Re: Re: Re: Re: Re: Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook, o haya, 07/10/2015
- [chef] Re: Re: Re: Re: Re: Re: Re: Using UNC path was Re: Re: Re: Re: A question about chef-splunk cookbook, Tensibai Zhaoying, 07/11/2015
Archive powered by MHonArc 2.6.16.