Skip to main content

Generate config files from 'conf.d' like directories

Project description

Generate config files from conf.d like directories.

Split your config file into smaller files in a conf.d like directory. The generated config file will be the concatenation of all splitted config files (also called snippets). The spplited files will be merged in the lexical order of their names.

Files ending with .bak, .old and other similar terminations will be ignored.

This project was based in the update-conf.d project.

Install

This project requires Python 2.6 or newer.

PS: It’s possible to use Python 3 also. However, it is not well tested.

In Ubuntu/Debian:

apt-get install python

To install:

pip install update-conf.py

It’s possible to clone the project in Github and install it via setuptools:

git clone git@github.com:rarylson/update-conf.py.git
cd update-conf.py
python setup.py install

Usage

If you run:

update-conf.py -f /etc/snmp/snmpd.conf

The script will merge the splitted config files in the directory /etc/snmp/snmpd.conf.d into the file /etc/snmp/snmpd.conf.

If the directory containing the splitted files uses a diferent name pattern, you can pass its name as an argument:

update-conf.py -f /etc/snmp/snmpd.conf -d /etc/snmp/snmpd.d

It’s also possible to define frequent used options in a config file (/etc/update-conf.py.conf). For example:

[snmpd]
file = /etc/snmp/snmpd.conf
dir = /etc/snmp/snmpd.d

Now, you can run:

update-conf.py -n snmpd

To get help:

update-conf.py --help

License

This software is released under the Revised BSD License.

Changelog

You can see the changelog here.

TODO

  • Publish this software in a Ubuntu PPA;

    • Ubuntu 12.04 and Ubuntu 14.04;

  • Use Travis as a continuous integration server;

  • Hide “bugtracker_url” warning when running setup.py with setuptools;

  • Use code coverage (coverage) and flags in README.md;

  • Create tests for 100% code coverage;

  • Code covarage after tests:

    • cd htmlcov && python -m SimpleHTTPServer 8888 && open http://localhost:8888.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

update-conf.py-0.4.1.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

update_conf.py-0.4.1-py2-none-any.whl (9.0 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page