Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Aug 16, 2015 10:52 am 
Offline
Newbie

Joined: Wed Jul 22, 2015 7:54 am
Posts: 4
there is a lot of things I need to do manully before I can add server to the stack..
lets say I have php app and I want to spawn another server I need to:
set hostname
configure etc/hosts
configure private ip
configure iptable to allow private networking

and all this annoying things that I dont always remember how so I search for articles, and all the articles are for digital ocean so I need to change some things and so on..
there must be some solution that i am missing?


Top
   
PostPosted: Sun Aug 16, 2015 11:13 am 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
There exists an entire ecosystem of configuration management projects with various goals / scopes / dreams:

* Salt -- http://saltstack.com/
* Puppet -- https://puppetlabs.com/
* Chef -- https://www.chef.io/
* Ansible -- http://www.ansible.com/home

The basic idea is that you stop doing these things manually and start defining in your config management what you want done. It then does the actual day-to-day legwork of applying your configuration onto your systems.

- Les


Top
   
PostPosted: Sun Aug 16, 2015 1:06 pm 
Offline
Senior Newbie

Joined: Wed May 06, 2015 1:14 pm
Posts: 5
akeri's answer is absolutely the way to go; however, there is a learning curve at the beginning and you have to dedicate sometime to learn about the different server provisioning tools out there, and then decide on which one fits your needs and again learn the basic usage scenarios to that specific tool you chose.

I myself tend to be a little lazy when it comes to provisioning servers, and I have relied always on simple bash scripts which I have written myself.

First I have a script called provision_root.sh. I use this script immediately after I Rebuild my server with Ubuntu 14.04 LTS. I call it provision_root.sh because this is the one I use when I log into the VPS as root, and it does root operations; such as, creating users, changing hostname, etc...

I then scp this script provision_root.sh to the vps
$ scp provision_root.sh root@your-ip-address
I log into the server as root and I simply run it
$ ./provision_root.sh
This script contains all the commands that you would have written manually on the command line. All of them stacked vertically, for example:

apt-get install vim
echo "your host name" > /etc/hosts
createuser my_user_name
....
...
.
reboot now

Then I have another script called provision_my_user_name.sh
Once the server is up again after the final reboot I again scp this script into the vps
$ scp provision_my_user_name.sh
and I log into it...you can get the picture

Now let's say you're production environment is a rails + postgres + unicorn + nginx.
This bash script will contain all commands that will install all components needed for production

\curl rvm | source ~/.rvm
rvm install ruby
gem install rails
gem install bundler
apt-get install nginx
apt-get install postgres
...
..
.
reboot now

And that's it! your server is ready. I hope this helps.


Top
   
PostPosted: Wed Aug 19, 2015 8:18 am 
Offline
Senior Newbie
User avatar

Joined: Tue Aug 18, 2015 1:13 pm
Posts: 12
boynet wrote:
there is a lot of things I need to do manully before I can add server to the stack..
lets say I have php app and I want to spawn another server I need to:
set hostname
configure etc/hosts
configure private ip
configure iptable to allow private networking

and all this annoying things that I dont always remember how so I search for articles, and all the articles are for digital ocean so I need to change some things and so on..
there must be some solution that i am missing?


If you cant remember how then I suggest you only to continue doing it manually until you will be able to remember what to do. Other wise you're going to remember only how to launch scripts. And manual configuration is important thing to learn. Otherwise without understanding what are you doing you're just going to make yourself easy to pwn. Especially when Ubuntu is most automated and easiest to handle server of all.

Automation becomes vital only when you need to configure hundreds of servers. So no clue how ti configure few of them. Going to leave you dependent not only on whole ubuntu automation, but as well as on someones scripts. and forums full of asking of dumb questions.

_________________
“There was no such thing as a fair fight. All vulnerabilities must be exploited.”
― Cary Caffrey
Image
Image


Top
   
PostPosted: Fri Aug 21, 2015 12:59 pm 
Offline
Senior Newbie

Joined: Fri Aug 21, 2015 12:54 pm
Posts: 5
I think you can also build a custom script to automate the server creation and VPS creation by installing that script on your main node or main server.

_________________
http://paknode.com/ - The Ultimate Website


Top
   
PostPosted: Mon Aug 24, 2015 8:18 am 
Offline
Linode Staff

Joined: Mon Sep 29, 2014 4:47 pm
Posts: 90
Twitter: FelicianoTech
You can create a StackScript that configures a Linode the way you want on deployment. https://www.linode.com/stackscripts

In your scenario, I would create a StackScript that deploys your distro with one of the configuration management tools akerl mentioned. Then have that tool (say Salt) configure the rest.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group