2

I want to store the configurations from a set of 50 servers deployed in the field. These configurations are like (/etc/my.cnf, /etc/httpd/conf/httpd.conf, etc..). Imagine that there are about 100 different files I want to keep track of (for each server). Also, imagine that there will be some changes in the configurations between servers (for some reasons, I cannot keep one version for all the servers).

I use bitbucket.org's account. I want to know the best way to organize the files..

A) As separate folders for each server in a single repository:
Like,

bitbucket.org/path/repository/server001/file1 to file100
bitbucket.org/path/repository/server002/file1 to file100
bitbucket.org/path/repository/server100/file1 to file100

Remember 'server001' and the likes are all folders. In server number 2, I don't need the folders of 'server001'. When I clone, I get all the folders in the repository (unless you teach me how to clone specific folders). As the servers increase, this increases complexity.

B) Each server as separate repository:
Like,

bitbucket.org/path/server-001-repository/folders_here
bitbucket.org/path/server-002-repository/folders_here

With this, I can retrieve files only from specific repository at a specific server.

C) Each server as a branch:
Like,

server-001 is a branch on one set of configuration files
server-002 is a branch on the same set of configuration files

I am yet to create all the repositories / folders / files.

Yours inputs will definitely help me.

Jayan
  • 18,003
  • 15
  • 89
  • 143
  • My vote is to have folders per each server and branch per environment (prod vs dev) – Jayan May 19 '17 at 14:00
  • Please consider tools like Ansible /Chef/puppet/rundeck – Jayan May 19 '17 at 14:02
  • Puppet with hiera handles something like this very well. You keep puppet code in one repository then, and hiera holds just variables used by puppet. – BartBiczBoży May 19 '17 at 14:11
  • Thanks @Jayan, I will for now, consider folders per each server. There are no 'dev' branch here... all of them are production servers. Also, I have will have to use Sparse Checkout feature of git as explained [http://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository]. – Govinda Padaki May 20 '17 at 17:00

0 Answers0