-1

We have two physically separated management servers for two separate computer clusters (all systems run CentOS 8) and both management servers running xcat. One is a test environment (call test) and the other is the production (call prod) environment. They are ALMOST identical, but there are some important file system related differences that must be maintained between the management servers.

We first test a new system change in test, check that nothing is broken, and then roll it out to prod. There is a directory, /install/, on both management servers that contains the xcat configuration files. When a change is made in /install/, we copy those changes to another directory (on the same management server), called /backup_install.

On both management servers (i.e. test and prod), /backup_install is version controlled with git.

So a typical change might go like :

  1. Change a configuration file in /install on the test management server
  2. Roll the change out to the test cluster
  3. Check the integrity of the test cluster
  4. If its OK, copy changes on test management server from /install to /backup_install
  5. Commit the changes in /backup_install with git
  6. rsync the changes in /install from test management server to /install on prod management server
  7. Copy changes on prod management server from /install to /backup_install
  8. Commit the changes in /backup_install on prod with git

Frequently, users forget to commit changes in /backup_install on one of the management servers.

One thought I had was to put /install under version control, instead of /backup_install. However, xcat / confluent, use those directories directly and I'm mildly paranoid about putting unexpected things (e.g. .git) in directories used by tools that I don't fully understand.

Question : We are clumsily maintaining two separate git repos on very similar systems on two different management servers. Is there a more efficient, less error prone way of doing this?

irritable_phd_syndrome
  • 4,631
  • 3
  • 32
  • 60

1 Answers1

0

You can store the .git/ directory somewhere else, and instruct git to use that other location as its database :

git --git-dir=/backup_install/.git --work-tree=/install status
git --git-dir=/backup_install/.git --work-tree=/install add file1 file2 ...
git --git-dir=/backup_install/.git --work-tree=/install commit

You can also indicate these values using the GIT_DIR and GIT_WORK_TREE environment variables.

See the doc for the --git-dir option.

You can use these to create appropriate aliases or scripts for your use case.

LeGEC
  • 46,477
  • 5
  • 57
  • 104