Skip to content

Jeoffreybauvin/puppenc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8c4f0be · Jul 30, 2021
Jul 30, 2021
May 22, 2019
May 22, 2019
Apr 15, 2017
May 17, 2018
May 22, 2019
Feb 14, 2017
Jun 19, 2017
Apr 11, 2017
Feb 14, 2017
Sep 22, 2017
May 22, 2019
May 22, 2019
Sep 14, 2018
Jun 16, 2017
Apr 15, 2017
May 22, 2019
Mar 29, 2017
May 22, 2019
Apr 7, 2017

Repository files navigation

puppenc

A simple external node classifier (ENC) for Puppet

Build Status

Specs

Object Methods Description
Classes GET, POST, DELETE Manage Puppet's classes
Environments GET, POST, DELETE Manage Puppet's environments
Hostgroups GET, POST, DELETE Manage Puppet's hostgroups
Nodes GET, POST, PUT, DELETE Manage Puppet's nodes
ENC GET Manage ENC resources

Dev environment

docker-compose.yml

version: '2'
services:
  puppenc-api:
    image: puppenc/api:latest
    restart: always
    ports:
      - "5000:5000"
      - "5001:5001"
    volumes:
      -  /root/puppenc/api:/puppenc
    links:
      - puppenc-mysql
    entrypoint:
      - python
      - run.py
  puppenc-mysql:
    image: mysql:5.6
    ports:
      - "3306"
    environment:
      MYSQL_ROOT_PASSWORD: 'puppenc'
      MYSQL_DATABASE: 'puppenc'

Then :

docker-compose up
docker-compose exec puppenc-api python shell.py
$ sudo apt-get install libmysqlclient-dev
$ virtualenv -p python3 venv
$ . venv/bin/activate
$ pip install -r requirements.txt

Tests

I'm using pyresttest :

In my virtualenv :

$ pip install pyresttest

$ cd tests

$ (venv)~/puppenc/tests(develop ✗) ./launch_tests.sh http://127.0.0.1:5000
Test Group Environments SUCCEEDED: : 5/5 Tests Passed!
Test Group Start SUCCEEDED: : 1/1 Tests Passed!

I need a GUI

You should not need a GUI. But, if you want to, you can use (Flask_Admin)[https://flask-admin.readthedocs.io/en/latest/].

In my virtualenv :

$ docker-compose exec puppenc-api python admin.py
 * Running on http://0.0.0.0:5001/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 730-803-037

And browse to (http://127.0.0.1:5001/admin/)[http://127.0.0.1:5001/admin/]

Some links related to Puppet's ENC

https://docs.puppet.com/guides/external_nodes.html#enc-output-format