Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate configuration in deploy/config #268

Open
prasadtalasila opened this issue Feb 6, 2018 · 5 comments
Open

Deduplicate configuration in deploy/config #268

prasadtalasila opened this issue Feb 6, 2018 · 5 comments

Comments

@prasadtalasila
Copy link
Member

Description

The configuration files in deploy/configs contain massive duplication. We can remove the duplication using two techniques.

  1. Pull all json files to deploy/config directory and merge json objects into one file. A good example to follow is gitlab.rb configuration file for GitLab.
  2. One config module to parse the config file and give selective information to all other modules. This module can be placed in util/

Don't try this until there is 90% coverage on all the unit tests.

@prasadtalasila
Copy link
Member Author

Not a priority right now.

@prasadtalasila
Copy link
Member Author

prasadtalasila commented Nov 9, 2018

We can use Jinja2 templates of Ansible to solve the issue. All the necessary config information is to be placed in [all:vars] section of the inventory file and the Jinja2 config templates will go into templates directory.

@prasadtalasila prasadtalasila reopened this Nov 9, 2018
@prasadtalasila
Copy link
Member Author

It is better to split the existing inventory file into two files: hosts file and variables file. Hosts file only contains the host and container names and (if required) connections. The variables file contains all the variables required for configuration. Both the files can be placed in deploy/inventory directory and have ansible.cfg point to the directory. See example1 and example2.

@prasadtalasila
Copy link
Member Author

Splitting it into hosts and variables files does not work in Ansible. Ansible requires the variables of a host to be available in the same inventory file in which the host is mentioned.

@prasadtalasila
Copy link
Member Author

The only remaining part is to write a config script which can spawn a webserver with the form to fill the configuration. Once the configuration is collected from the user, this information is used to update the inventory file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant