Download file from frontend to backend...

44 views
Skip to first unread message

Rick Fowler

unread,
Dec 1, 2017, 10:11:01 PM12/1/17
to stacki
Hi!

I want to copy a tarball from the frontend to the backend after the system is setup by Stacki, untar it, and run some scripts from it. I'm not sure the best way to achieve this as it seems the <post></post> section of a cart happens on the backend and I need to scp the file from the frontend.

The backend however doesn't get setup with keys to scp from the frontend password-lessly (and understandably).  Is there a way to get the frontend to maybe push the file over during provisioning process?  I can just then do the untaring and running in the <post></post> section I'm assuming.

What would be the suggested way to do this?  Thanks for any help!

Joe Kaiser

unread,
Dec 2, 2017, 11:10:11 AM12/2/17
to sta...@googlegroups.com
Hi Rick,

Is this a Stacki 4.0 or 5.0 system?

There are a couple of ways. 


The easiest is to turn it into an rpm and put it in a cart, that way it's available via yum and gets put on during the install. 

First way:

Untar the tarball on your frontend. I'm assuming it's all in one directory. 

We'll do an example:

% get usage

# stack create package
error - "name" parameter is required
[dir=string] [name=string] [prefix=string] [release=string] [rpmextra=string] [version=string]

I've got a directory we'll call /opt/stuff that has my stuff in it:

[root@kaiza ~]# mkdir /opt/stuff

[root@kaiza ~]# cp *.py* /opt/stuff/

[root@kaiza ~]# ls /opt/stuff/
arpit.py  file.py  getip.py  imp_foreign_redhat.py  temp.py  test1.py  test.py  test.py.prom

Now I'm going to create a package for it:

stack create package dir=/opt/stuff prefix=/opt name=mystuff

Note that the prefix is one dir up from the actual "stuff" otherwise I get /opt/stuff/stuff.

The rpm is created in the directory you ran the comman from. Since my example's name was "mystuff"

# ls mystuff*.rpm

mystuff-3.2-1.x86_64.rpm

Note a couple of things. I did this on Stacki 3.2 system so the version is 3.2 and the release is 1 since that's the first time I did it. These are default. If you want to do a version and release, then put that with the "stack create package" arguments. 

Now I check it, because I want to make sure.

# rpm -qpl mystuff-3.2-1.x86_64.rpm
/opt/stuff/arpit.py
/opt/stuff/file.py
/opt/stuff/getip.py
/opt/stuff/imp_foreign_redhat.py
/opt/stuff/temp.py
/opt/stuff/test.py
/opt/stuff/test.py.prom
/opt/stuff/test1.py

Now I can put this in a cart in the RPMS directory and in the cart xml file I do "<package>mystuff</package>" and it will be on the backends and available via yum.

To call your scripts in post tags:

<post>

/opt/stuff/bin/whatever.sh 

</post>

The second way:

Create a cart, put the tar file in the RPMS directory. You can't call this in a package tag, but it's under the webserver directories so you can wget it or curl it in post tags.

Copy your tar file to RPMS in a cart directory. In this example the cart is my "site-custom" cart.

<post>
wget --no-check-certificate https://&Kickstart_PrivateAddress;/install/carts/site-custom/RPMS/mystuff.tar.gz

tar -xzf mystuff.tar.gz

/run/any/scripts/here

</post>

Creating a package is the preferred method.

Thanks,

Joe

--
You received this message because you are subscribed to the Google Groups "stacki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stacki+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rick Fowler

unread,
Dec 2, 2017, 1:19:41 PM12/2/17
to stacki
Well, that's neat!  I'll give it a try in a bit.

As far as version that is still optional as we are just starting to use Stacki.  Are you able to deploy Centos 6.8 with Stacki 5?  Using 6.8 is really the only requirement.  Or do I need to use the Centos 6/Stacki 4 version?

Is the process the same for 4 or 5, just make the tarball into a RPM?

One more question, with the acquisition of Stackiq by Teradata, is the paid version and support of Stacki history?  Or are there up and coming options via Teradata?  Just curious.

Thanks for the quick replay, much appreciated.
To unsubscribe from this group and stop receiving emails from it, send an email to stacki+un...@googlegroups.com.

Joe Kaiser

unread,
Dec 2, 2017, 3:03:16 PM12/2/17
to sta...@googlegroups.com
On Sat, Dec 2, 2017 at 11:19 AM, Rick Fowler <rickl...@gmail.com> wrote:
Well, that's neat!  I'll give it a try in a bit.

As far as version that is still optional as we are just starting to use Stacki.  Are you able to deploy Centos 6.8 with Stacki 5? 

I don't know. I haven't tried it. Why is 6.8 required versus 6.9 or 7.x?
 
Using 6.8 is really the only requirement.  Or do I need to use the Centos 6/Stacki 4 version?


I'll test this week to see if Stacki 5.0 works with a 6.8 iso. Not sure if it will. If not, you'll need to stick with Stacki 4.0 for a bit. 
 
Is the process the same for 4 or 5, just make the tarball into a RPM?


Yup.

 

One more question, with the acquisition of Stackiq by Teradata, is the paid version and support of Stacki history?  Or are there up and coming options via Teradata?  Just curious.


Yes, paid version and support for Stacki is a bygone era. There are no options via Teradata that I am aware of at this point. 

Sounds like a good business opportunity for someone. You could name it ClusterCorp*.

Thanks,

Joe



* Throwback Saturday! Back in the early Rocks days, this was the name of the company started by our initial co-founder that provided commercial support and licensing for Rocks.
I worked at as a part-time engineer before ClusterCorp morphed into StackIQ. 

 
To unsubscribe from this group and stop receiving emails from it, send an email to stacki+unsubscribe@googlegroups.com.

Rick Fowler

unread,
Dec 4, 2017, 9:20:11 PM12/4/17
to stacki
Centos 6.8 is the backend for my companies' service so that's what they require for now.

I tried deploying 6.8 on Stacki5 but it kept on getting hung up on the partitioning for some reason.  Probably the anaconda versions are not the same?

Joe Kaiser

unread,
Dec 4, 2017, 10:31:24 PM12/4/17
to sta...@googlegroups.com
Anaconda is definitely not the same. We have not done the work for 6.x yet on Stacki 5.0. If you need it, stick with 4.0 for the moment. 

Thanks,

Joe


To unsubscribe from this group and stop receiving emails from it, send an email to stacki+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages