New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic Feature Handling #33

Open
wants to merge 8 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@mkayontour
Member

mkayontour commented Nov 8, 2018

Put some work into the generic feature handling, quick overview.
I added two templates in jinja2:

  • object_attributes.j2 handles the calculation of keys and values on a object.
  • feature_generic_template includes the object attribute calculation and creates the feature.conf

I added a dictionary which handles all features and their attributes.
By Default the dictionary is empty and won't manage features until some are defined.

The structure is easy and gives every user the ability to customize and add features.

i2_custom_features:
  ApiListener:                           #ObjectType
    api:                                       #ObjectName
      accept_command: true    #ObjectAttribute
      accept_config: true          #ObjectAttribute
  GraphiteWriter:
    graphite:
      host: "127.0.0.1"
      port: "2004"
    graphite2:
      host: "10.10.0.5"
      port: "2014"
  IdoMysqlConnection:
    mysql-ido:
      host: "127.0.0.1"
      port: 3306
      user: "icinga"
      password: "icinga"
      database: "icinga"
      cleanup: 
        downtimehistory_age: 48h
        contactnotifications_age: 31d

In addition I added a trigger that the user can remove unmanaged features to have the full control over all features.

How does this sound and look, please give feedback.

Test is available at the branch via molecule converge

refs #12

@mkayontour

This comment has been minimized.

Member

mkayontour commented Nov 9, 2018

@aflatto can you have a look at?

@aflatto

aflatto approved these changes Nov 9, 2018

@aflatto

This comment has been minimized.

Collaborator

aflatto commented Nov 9, 2018

I am running some testing, when I am done I will merge it

@aflatto

This comment has been minimized.

Collaborator

aflatto commented Nov 20, 2018

@mkayontour custom variable should not be in the /defaults but in the /vars as that is the place for customisation.

@aflatto

This comment has been minimized.

Collaborator

aflatto commented Nov 20, 2018

I have added the following configuration to the defaults/main.yml file :
i2_custom_features: {
IdoMysqlConnection:
mysql-ido:
host: "127.0.0.1"
port: 3306
user: "icinga"
password: "icinga"
database: "icinga"
cleanup:
downtimehistory_age: 48h
contactnotifications_age: 31d
}
and run the ansible playbook - the result failed to generate the ido feature file.
[root@ip-172-31-34-250 icinga2]# ll features-enabled/
total 0
lrwxrwxrwx. 1 root root 34 Nov 20 13:34 checker.conf -> ../features-available/checker.conf
lrwxrwxrwx. 1 root root 34 Nov 20 13:34 mainlog.conf -> ../features-available/mainlog.conf
lrwxrwxrwx. 1 root root 39 Nov 20 13:34 notification.conf -> ../features-available/notification.conf

Can you show me your tests ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment