Metadata-Version: 2.0
Name: update-conf.py
Version: 0.3.4
Summary: Generate config files from 'conf.d' like directories
Home-page: https://github.com/rarylson/update-conf.py
Author: Rarylson Freitas
Author-email: rarylson@gmail.com
License: Revised BSD
Download-URL: https://github.com/rarylson/update-conf.py/tarball/0.3.4
Keywords: system unix config split snippets sysadmin
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Dist: argparse (>=1.2)
Requires-Dist: configparser (>=2.3)
Provides-Extra: dev
Requires-Dist: setuptools (>=0.8); extra == 'dev'
Requires-Dist: pypandoc (>=0.9); extra == 'dev'

update-conf.py
==============

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 <https://github.com/Atha/update-conf.d>`__.

Install
-------

This project requires Python 2.6 or newer.

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

In Ubuntu/Debian:

.. code:: sh

    apt-get install python

To install:

.. code:: sh

    pip install update-conf.py

It's also possible to clone the project in Github and install via
``setuptools``:

.. code:: sh

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

Usage
-----

If you run:

.. code:: sh

    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:

.. code:: sh

    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:

.. code:: ini

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

Now, you can run:

.. code:: sh

    update-conf.py -n snmpd

To get help:

.. code:: sh

    update-conf.py --help

License
-------

This software is released under the `Revised BSD
License <https://github.com/rarylson/update-conf.py/blob/master/LICENSE>`__.

TODO
----

-  Problems with the config file install;

   -  It can generate errors while instaling the project in a local env,
      or using ``--user``;
   -  A think the application should search for a config file in
      ``/etc`` or in ``sys.prefix/etc``;
   -  See:
      http://stackoverflow.com/questions/7567642/where-to-put-a-configuration-file-in-python;
   -  See: https://pythonhosted.org/mrjob/guides/configs-basics.html;

-  Publish this software in a Ubuntu PPA;

   -  Ubuntu 12.04 and Ubuntu 14.04.


