1.0.0-alpha-8 • Published 3 years ago

config-generator-ansible-node v1.0.0-alpha-8

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
3 years ago

Config-generator-ansible-node

npm (tag)

Config-generator-ansible-node is a TypeScript library for generating config and secure delivery using ansible for any of your services like nginx or mysql from your NodeJS application.

Step 1. Installing config-generator-ansible-node

npm i config-generator-ansible-node --save 
import ConfigGenerator from 'config-generator-ansible-node'; 

Step 2. Installing Ansible

Please see the ansible documentation: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html

Additional information:

Usage

const ConfigGeneratorHandler = new ConfigGenerator();
ConfigGeneratorHandler.generate('/tmp/YOUR-SERVICE.conf', {'PORT': 3000}, '/etc/YOUR-SERVICE.conf').then(() => {
    console.log('Awesome :)');
}).catch(() => {
    console.log('Something went wrong...');
});

Methods

1. generate(sourcePath: string, options: object, destinationPath: string): Promise<void>;
2. compile(sourcePath: string, options: object): Promise<string>;
3. write(destinationPath: string, configData: string): Promise<boolean>;

Products that use Config-generator-ansible-node

Alt text

License

Apache License 2.0