Module Expr Str Import alias Import alias Import alias Import alias Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore Str FunctionDef arguments args defaults body Expr Str FunctionDef arguments args defaults body Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str Assign NameStore Call SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str Assign NameStore Call SubscriptLoad NameLoad Index Str Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Str Call SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr Str Call SubscriptLoad NameLoad Index Str If UnaryOpNot NameLoad body Assign NameStore SubscriptStore NameLoad Index Str Call SubscriptLoad NameLoad Index Str Num Assign NameStore Dict Str Str Str Str Str Str Str Str Num Str NameLoad Str For NameStore ListLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Str Assign NameStore Dict Str Str NameLoad NameLoad Assign NameStore BoolOpOr BoolOpAnd CompareIn Str NameLoad CompareIn SubscriptLoad NameLoad Index Str ListLoad Str Str SubscriptLoad NameLoad Index Str CompareIn Str NameLoad Assign NameStore Dict Str Str NameLoad Dict Str Dict Str Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Num Dict Str NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str Str Dict Str Str Str Str Str Str Str Str Str Str Str Str Str ListLoad Str Str Str Str Str Str Str Str Str Str BinOpAdd SubscriptLoad NameLoad Index Str Str NameLoad BoolOpAnd CompareEq Str SubscriptLoad NameLoad Index Str NameLoad BoolOpAnd CompareEq Str SubscriptLoad NameLoad Index Str NameLoad Dict Str Str NameLoad Dict Str Str Str Str Str NameLoad ListLoad Str Dict Str Str Str Str Dict Str Str Str Str Str SubscriptLoad NameLoad Index Str Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str keyword AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str Dict Str Str Str Str Str Str Str Str Str Str Str NameLoad Dict Str Str NameLoad NameLoad Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Dict Str Str Str Str Str ListLoad Str Str Num Dict NameLoad Assign SubscriptStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str Call AttributeLoad Str attr Call AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str attr Str Str Expr Call SubscriptLoad NameLoad Index Str Str NameLoad keyword Str Return NameLoad decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return Call NameLoad decorator_list
N/A N/A 
.. _module_mc_icinga_web:

mc_icinga_web / icinga_web functions
============================================

when it is written that "each key will be treated as a parameter",
if you add keys in dictionary, they will be added
in the configuration file with

::

<ae:paremeter name="{{key}}">{{value}}</ae:parameter>


when it is written that "foo must be replace with foo value", you can
add as many sub-dictionaries as you want. All sub-dictionaries must
have the same structure. It is to avoid a list but in templates
it is treated as if there was a list of dictionaries.

I have prefered

::

    'foo': {
        'n1': {
            'param1': "v1",
        },
        'n2': {
            'param1': "v2",
        },
    },

instead of

::

    'foo': [
        {'name': "n1",
         'param1': "v1",
        },
        {'name': "n2",
         'param1': "v2",
        },
    ]


When a real list is kept, It is precised below. Generally it is
when the content is not structures but simple values.

The template of xml configuration files use a lot of loops
in order to add content easily but it is not the case with
the ini files where directives are limited and always the same.

The "nginx" and "phpfpm" sub-dictionaries are given to
macros in \*\*kwargs parameter. If you add a key in,
you can access in the nginx configuration template
or in phpfpm configuration template. In ngin
x subdictionary, the "icinga_cgi" and "icinga_web"
keys store values used to fill the template.

Otherwise, the first level of subdictionaries is
for distinguish configuration files. There is one
subdictionary per configuration file. The key used
for subdictionary correspond to the name of the file
but the "." is replaced with a "_"

I have not found dtd/xsd files in order to verify
grammar of xml files.

Only the hashed password and the salt for the root
account for icinga-web interface are stored in settings.
The hashed password is not computed automatically from an
other value with the clear password (settings
dictionary doesn't contains the clear password)

I should add a state to compute the hash from clear
password but I don't have successfully done this.

The keys "has_pgsql" and "has_mysql" determine
if a local postgresql or mysql instance must be installed.
The default value is computed from default database parameters
If the connection is made through a unix pipe
or with the localhost hostname, the booleans are set to True.

The default parameters for icinga_ido database
connection are get from icinga settings.

In the templates, I didn't perform a lot of check.
For example if a value must be set only if a other
directive has a precise value, I didn't add a if statement.
It is possible to create invalid configuration files.

If in a list, each value must be unique, I tried
to have the elements of the list as dictionary keys.

For optional values which don't have a default value,
I didn't set them in the default dictionary but in the
templates, I have done::

    {% if data.get('foo', None) %}
    foo={{data.foo}}
    {% endif %}

Theses optional values corresponds to commented keys in
the default dictionary.


 N/A logging N/A mc_states.api N/A hmac N/A hashlib N/A __name icinga_web N/A log N/A N/A logging getLogger __name__ N/A isalt 0c099ae4627b144f3a7eaa763ba43b10fd5d1caa8738a98f11bb973bebc52ccd N/A ngurl <![CDATA[http://nagvis.localhost/nagvis/frontend/nagvis-js/]]> settings N/A N/A N/A N/A N/A 
    icinga_web settings

    location
        installation directory

    package
        list of packages to install icinga-web
    configuration_directory
        directory where configuration files are located
    has_pgsql
        install and configure a postgresql service in order
        to store icinga-web data
        (no ido2db data)
    has_mysql
        install and configure a mysql service in order to store icinga-web data
        (no ido2db data)
    modules
        nagvis
            enable
                enable the nagvis module which add link to nagvis in icinga-web
            cronks_xml
                dictionary to store the cronks. The content is added in
                cronks.xml.  The structure is the same that 'cronks_xml'
                subdictionary.
        pnp4nagios
            enable
                enable the pnp4nagios module which add links to
                graphs in icinga-web
            package
                package to install for pnp4nagios integration
            cronks_extensions-templates
                dictionary in which, each key is the name of an extension
                template and the content of the dictionary contains the
                values to fill the template
                each 'key': "value" produce
                a "<parameter name={{key}}>{{value}}</parameter>".
                The key "parameter" or "parameter_*" produce
                a "<parameter></parameter>" tag.
                Each subdictionary add sub parameters tags.

    root_account
        Dictionary to store root account information.
        It is the account created on first installation of icinga_web

        login
            login for root login on web interface
        hashed_password
            password for root login on web interface
        salt
            salt used to hash the password

    databases
        dictionary to store databases connections parameters

        ido2db
            dictionary to store ido2db database connection parameters

            type
               type of sgbd used "pgsql" or "mysql"
            host
                host used for connection
            port
                port used for connection
            user
                user used for connection
            password
                password used for connection
            name
                database name
            prefix
                prefix used in table's names

        web
            dictionary to store icinga-web database connection parameters

            type
               type of sgbd used "pgsql" or "mysql"
            host
                host used for connection
            port
                port used for connection
            user
                user used for connection
            password
                password used for connection
            name
                database name

        nginx
            dictionary to store values of nginx configuration

            domain
                name of virtualhost created to serve webpages
            doc_root
                root location of virtualhost
            vh_content_source
                template file for nginx content file
            vh_top_source
                template file for nginx top file

            icinga_web
                dictionary to store values used in templates given in
                vh_content_source and vh_top_source

                web_directory
                    location under which webpages of icinga-web will be
                    available
                images_dir
                    directory where images used by icinga-web are stored
                styles_dir
                    directory where css used by icinga-web are stored
                bpaddon_dir
                    directory where bpaddon scripts are located
                ext3_dir
                    directory where ext3 scripts are located
                fastcgi_pass
                    socket used to contact fastcgi server in order to
                    interpret php files

        phpfpm
            dictionary to store values of phpfpm configuration

            open_basedir
                paths to add to open_basedir
            extensions_package
                additional packages to install (such as php5-pgsql
                or php5-mysql for
                php database connection)
            doc_root
                root location for php-fpm
            session_auto_start
                must be 0 to run icinga-web
     _settings N/A N/A N/A N/A N/A grains __grains__ N/A pillar __pillar__ N/A locs N/A N/A __salt__ N/A mc_locations.settings N/A icinga_settings N/A N/A __salt__ N/A mc_icinga2.settings N/A ido2db_database N/A N/A N/A icinga_settings N/A modules N/A ido2db N/A database N/A icinga_web_reg N/A N/A __salt__ N/A mc_macros.get_local_registry icinga_web registry_format pack N/A password_web_db N/A N/A icinga_web_reg setdefault web.db_password N/A N/A __salt__ N/A mc_utils.generate_password N/A password_web_root_account N/A N/A icinga_web_reg setdefault web.root_account_password N/A N/A __salt__ N/A mc_utils.generate_password N/A N/A password_web_root_account N/A N/A password_web_root_account N/A icinga_web_reg N/A web.root_account_password N/A N/A __salt__ N/A mc_utils.generate_password 8 N/A web_database N/A type host port user password name pgsql localhost 5432 icinga_web password_web_db icinga_web N/A data N/A ido2db_database web_database N/A N/A N/A N/A data setdefault prefix N/A root_account N/A password salt password_web_root_account isalt N/A has_sgbd N/A N/A N/A host web_database N/A N/A web_database N/A host N/A localhost 127.0.0.1 N/A grains N/A host N/A socket web_database N/A NAVGIS_DEFAULTS N/A enabled cronks_xml True N/A cronks N/A iFrameViewNagvis N/A module action hide description name image categories position parameter Cronks System.IframeView false Nagvis Maps views Nagvis Display cronks.Info2 misc 310 N/A url ngurl N/A data N/A N/A __salt__ N/A mc_utils.defaults makina-states.services.monitoring.icinga_web N/A package configuration_directory create_pgsql has_pgsql has_mysql modules root_account ldap_auth databases nginx phpfpm templates has_jasper N/A icinga-web php5-ldap php5 php5-cli php-pear php5-xmlrpc php5-xsl php-soap php5-gd php5-ldap N/A N/A locs N/A conf_dir /icinga-web True N/A N/A pgsql N/A web_database N/A type has_sgbd N/A N/A mysql N/A web_database N/A type has_sgbd N/A nagvis pnp4nagios NAVGIS_DEFAULTS N/A pnpfornagios_url enabled package cronks_extensions_templates http://phpfornagios.local True N/A icinga-web-pnp N/A pnp-host-extension.xml pnp-service-extension.xml salt://makina-states/files/usr/share/icinga-web/app/modules/Cronks/data/xml/extensions/pnp-host-extension.xml salt://makina-states/files/usr/share/icinga-web/app/modules/Cronks/data/xml/extensions/pnp-service-extension.xml N/A login clear hashed_password salt root N/A root_account N/A password N/A N/A N/A N/A hmac new N/A root_account N/A salt N/A root_account N/A password digestmod N/A hashlib sha256 hexdigest N/A root_account N/A salt N/A url binddn bindpw filter_user base_dn tls (&(uid=__USERNAME__)) False N/A ido2db web ido2db_database web_database N/A ssl_cacert ssl_cert ssl_key domain doc_root vh_content_source vh_top_source icinga_web icinga-web.localhost /usr/share/icinga-web/www/ salt://makina-states/files/etc/nginx/sites-available/icinga-web.content.conf salt://makina-states/files/etc/nginx/sites-available/icinga-web.top.conf N/A htpasswd_file web_directory images_dir styles_dir bpaddon_dir ext3_dir fastcgi_pass /etc/icinga2/htpasswd.users /icinga-web /usr/share/icinga-web/app/modules/$1/pub/images/$2 /usr/share/icinga-web/app/modules/$1/pub/styles/$2 /usr/share/icinga-web/app/modules/BPAddon/pub /usr/share/icinga-web/lib/ext3/ unix:/var/spool/www/icinga-web_localhost.fpm.sock N/A open_basedir extensions_packages doc_root session_auto_start /usr/share/icinga-web/:/etc:/var/run/icinga2/cmd/:/var/cache/icinga-web/:/var/log/icinga-web/ N/A php5-pgsql /usr/share/icinga-web/ 0 N/A False N/A N/A N/A N/A data N/A nginx N/A icinga_web N/A fastcgi_pass N/A N/A unix:/var/spool/www/{0}.fpm.sock format N/A N/A N/A N/A data N/A nginx N/A domain replace . _ N/A N/A N/A __salt__ N/A mc_macros.update_local_registry icinga_web icinga_web_reg registry_format pack N/A data N/A N/A N/A N/A mc_states api lazy_subregistry_get __salt__ __name N/A N/A _settings N/A