Generate config files from 'conf.d' like directories
Project description
update-conf.py
Generate config files from conf.d
like directories.
Split your config file into smaller files, called snippets, in a conf.d
like directory. The generated config file will be the concatenation of all snippets, with snippets ordered by the lexical order of their names.
Files ending with .bak
, .old
and other similar terminations will be ignored.
This project was based on the update-conf.d project.
Install
This project works in Python 3 (3.7 or newer).
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
To generate a config file, you can run something like this:
update-conf.py -f /etc/snmp/snmpd.conf
The example above will merge the snippets in the directory /etc/snmp/snmpd.conf.d
into the file /etc/snmp/snmpd.conf
.
If the directory containing the snippets 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 frequently used options in a config file. For example, in /etc/update-conf.py.conf
:
[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
Config files
update-conf.py
will use the global config file (/etc/update-conf.py.conf
) or the user-home config file (~/.update-conf.py.conf
) if they exist.
You can use the the sample config file (provided within the distributed package) as a start point:
cp ${prefix}/share/update-conf.py/update-conf.py.conf /etc/update-conf.py.conf
It's also possible to pass a custom config file via command line args:
update-conf.py -c my_custom_config.conf -n snmpd
License
This software is released under the Revised BSD License.
Changelog
Check the CHANGELOG page.
Contributing
If you want to contribute with this project, check the CONTRIBUTING page.
TODO
- Publish this software in a Ubuntu PPA.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for update-conf.py-1.0.2.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 144a19b8f615f995ef2599efb8edb7ad8969cbadc02ac055cfc082963acf2ce1 |
|
MD5 | 79a38078f0226d37e86a12e4c38a8f9c |
|
BLAKE2b-256 | 8d750731c497cfed19802ad72168fe6f85198d10a7b69b1d1bf04e5d4324cf1b |
Hashes for update_conf.py-1.0.2.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df9c1430956838f037bb89e2c2847bdf1d7e4d6c34d5060511347f32fec35eda |
|
MD5 | 4507f1868941c7703341094b86701579 |
|
BLAKE2b-256 | d09faab00da0b4017b6124787e2b5b1184ea19f01a575f9605c9c698cdc25c93 |