Managing user configuration files across multiple computers
At the moment, I use a cloned git repo. To keep things simple, the only file that needs to vary between the different machines is .bashrc
. It's nice if there can be just one version of this file that responds differently on different machines. Thus, in my .bashrc
:
if [ $(hostname) == 'host1' ]; then
# things to do differently on host1.
elif [ $(hostname) == 'host2' ]; then
# things to do differently on host2.
fi
This obviously has some limitations (such as that a different technique would be required for .vimrc
or other config files needing customization), but it works fairly well.
Handling web.config differences across multiple machines when using version control
VS 2010 will provide you with a lot of control to manage web.config files for various configurations... Please check out.
How would you centralize configuration across multiple projects?
If you want to maintain the standard configuration interface, take a look at the ProtectedConfigurationProvider. This provider lets you store your configuration data outside of a standard configuration file, encrypt it however you like, or redirect requests for configuration in any way you see fit:
- Redirecting Configuration with a Custom Provider - Wrox
- Implementing a Protected Configuration Provider - MSDN
- Protected Configuration - Blayd Software
The beauty of this approach is that nothing changes in your existing applications. They don't need to know where their configuration is stored. The retrieval of configuration data is isolated in the provider. You can store it in a central file, store it in a database, or access it via a web service. If you change your mind, you only have to update your provider. Everything else stays the same.
Manage custom, machine specific configuration files in Salt
I don't know about Salt but in general in Configuration Management tools there is groups of hosts for several machines with the same configuration, templates and variables for customization for each machine
for example you can specify variable port=8888
for host1
and port=9999
for host2
but nginx-template will be something like this:
server {
listen {{port}};
}
for the both servers.
The same idea with machine specific data example(ansible):
- name: start container with mon
docker:
name: test-mongo
state: reloaded
image: mongo
when: master_ip == ansible_default_ipv4.address
where master_ip
is my variable and ansible_default_ipv4.address
is ip which ansible was connected to this host.
Hope this helps.
Related Topics
Linux Kernel "Historical" Git Repository with Full History
How to Run Vi on Docker Container
What Exactly Is Sudo Bang Bang
Rm Fails to Delete Files by Wildcard from a Script, But Works from a Shell Prompt
Rtmp: Is There Such a Linux Command Line Tool
How to Find My Shell Version Using a Linux Command
Bash with Aws Cli - Unable to Locate Credentials
How Does the Linux Kernel Determine the Order of _Init Calls
What Does "Soft/Hard Nofile" Mean on Linux
How to Recompile Just a Single Kernel Module
How to Perform a 'Git Pull' Without Re-Entering My Ssh Password
How to Pass Argument in Expect Through the Command Line in a Shell Script
Remove the Last Page of a PDF File Using PDFtk