Giter Site home page Giter Site logo

Comments (8)

jjethwa avatar jjethwa commented on August 12, 2024

Hi @preske87

I'm currently away, but will be back next week. There are too many variations to handle for what a user might do, so the assumption was that if anything was under /etc/icinga2, the user had already created the correct configurations. The basic check is here: https://github.com/jjethwa/icinga2/blob/master/content/opt/setup/50-icinga2#L17 You could modify the check to ignore your custom directory or modify the icinga2 helper script to copy over the contents of /etc/icinga_custom once the defaults are copied over. I'd be happy to review a PR, but I think the best option would be to use the Director module as it's already included and has a variety of options for importing configs. Let me know what you think.

from icinga2.

preske87 avatar preske87 commented on August 12, 2024

Hi @jjethwa ,
thank you for the invitation. I wanted to take the liberty to create a new branch and raise a pull request from there. But github tells me I am not allowed to create a new branch :(

Thus my idea:

Create a new file /content/opt/setup/69-post-installation-custom with following content

#!/bin/bash

if [ ! -z "$CUSTOM_POST_INSTALLATION_SCRIPT" ]
then 
    echo "Executing "$CUSTOM_POST_INSTALLATION_SCRIPT
    bash $CUSTOM_POST_INSTALLATION_SCRIPT
else
    echo "Environment variable CUSTOM_POST_INSTALLATION_SCRIPT is not set, will not execute any post installation script"
fi

Extend the table with the environment variables in README.md with this line

| `CUSTOM_POST_INSTALLATION_SCRIPT`| *unset* | Allows to specify a bash script, which is e.g. mapped through volume, which is executed at the end of the setup. Through this script it is e.g. possible to establish symlinks or copy files into default directories. |

When defining the container then, one can set this variable and have any freedom to execute code after the setup. That's I think the most flexible solution.

I happy you accept it.

from icinga2.

jjethwa avatar jjethwa commented on August 12, 2024

Hi @preske87

That looks good, I can test it when I get back. You can create a fork of the repo, make changes to the fork, then send a PR over to this repo so you get the credit 😃

from icinga2.

preske87 avatar preske87 commented on August 12, 2024

Thank you @jjethwa ,
there is the PR: #295

from icinga2.

jjethwa avatar jjethwa commented on August 12, 2024

Thanks @preske87 I'll review it asap next week 😄

from icinga2.

jjethwa avatar jjethwa commented on August 12, 2024

Hi @preske87

Thanks again for the PR, just merged it and a build is running now. The latest tag should be available for testing in 15-30 minutes. Really appreciate it 😄

from icinga2.

preske87 avatar preske87 commented on August 12, 2024

Hurray, after #297 it works properly

from icinga2.

jjethwa avatar jjethwa commented on August 12, 2024

Thanks, @preske87 you rock! 😃

from icinga2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.