Menu

Automating Updating Custom Modules

franco
2025-12-09
2025-12-10
  • franco

    franco - 2025-12-09

    Hello

    Has anybody manage to automate their custom extensions?

    The goal that every time i want to extend the data, it gets auto updated in itop.

    I have a xml using the unattended php and even though it says "installed" i dont see my module updated in the gui even after removing env-production.

    I only see this working correctly using the wizard.php gui

    I don't mind using toolkit but I dont know if it acually updates the extensions permanent or not and its purpose is for testing the extension.

     
  • odain

    odain - 2025-12-10

    Hello Franco,

    could you please detail your issue? how do you use the unattended CLI? what is the XML provided? what is the output of this script?

    BR,
    Olivier

     
  • franco

    franco - 2025-12-10

    When updating my extension using the http://<host>/setup/wizard.php method. It works all the time. </host>

    When try using the following command
    sudo -u apache /usr/bin/php /var/www/html/itop/setup/unattended-install/unattended-install.php --param-file=answer-file.txt --use_itop_config

    I get this output when running the command mentioned.

    Modules to install listed in itop_backup_config.xml (selected_modules section):
    authent-cas,authent-external,authent-ldap,authent-local,authent-token,combodo-backoffice-darkmoon-theme,combodo-backoffice-fullmoon-high-contrast-theme,combodo-backoffice-fullmoon-protanopia-deuteranopia-theme,combodo-backoffice-fullmoon-tritanopia-theme,combodo-db-tools,combodo-my-account,combodo-my-account-user-info,combodo-oauth2-client,combodo-password-expiration,combodo-webhook-integration,itop-attachments,itop-attribute-class-set,itop-attribute-encrypted-password,itop-backup,itop-bridge-cmdb-services,itop-bridge-cmdb-ticket,itop-bridge-datacenter-mgmt-services,itop-bridge-endusers-devices-services,itop-bridge-storage-mgmt-services,itop-bridge-virtualization-mgmt-services,itop-bridge-virtualization-storage,itop-test,itop-change-mgmt,itop-config,itop-config-mgmt,itop-core-update,itop-datacenter-mgmt,itop-endusers-devices,itop-files-information,itop-hub-connector,itop-oauth-client,itop-portal,itop-portal-base,itop-profiles-itil,itop-request-mgmt,itop-service-mgmt,itop-sla-computation,itop-storage-mgmt,itop-structure,itop-themes-compat,itop-tickets,itop-virtualization-mgmt,itop-welcome-itil
    Trace: Info - CheckBackupPrerequisites
    Trace: Info - PHP functions disabled:
    Info: mysqldump is present: Ok.
    Trace: Info - mysqldump -V said: mysqldump: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb-dump' instead
    Trace: Info - mysqldump -V said: mysqldump from 11.8.5-MariaDB, client 10.19 for Linux (x86_64)
    Starting the unattended installation...
    Starting the installation...
    Ok. 0 % done.
    Copying data model files
    Executing 'copy'
    Ok. 20 % done.
    Performing a backup of the database
    Executing 'backup'
    Ok. 20 % done.
    Compiling the data model
    Executing 'compile'
    Ok. 40 % done.
    Updating database schema
    Executing 'db-schema'
    Ok. 60 % done.
    Creating profiles
    Executing 'after-db-create'
    Ok. 80 % done.
    Loading data
    Executing 'load-data'
    Info: All data loaded
    99 % done.
    Creating the configuration File
    Executing 'create-config'
    Info: Configuration file created
    100 % done.
    use config file provided by backup in /var/www/html/itop/conf/production/config-itop.php.PHP Warning: copy(/var/www/html/itop/conf/production/config-itop.php): Failed to open stream: Permission denied in /var/www/html/itop/setup/unattended-install/unattended-install.php on line 397
    installed!

    This is my answer-file.xml, my extension is called "itop-test"

    <installation>
    <mode>upgrade</mode>
    <preinstall>
    <copies type="array">
    <backup>
    <destination>/var/www/html/itop/data/backups/manual/before-extupdate.tar.gz</destination>
    <configuration_file>/var/www/html/itop//conf/production/config-itop.php</configuration_file>
    </backup>
    </copies></preinstall>
    <source_dir>datamodels/2.x/</source_dir>
    <datamodel_version>3.2.1</datamodel_version>
    <previous_configuration_file>/var/www/html/itop//conf/production/config-itop.php</previous_configuration_file>
    <extensions_dir>extensions</extensions_dir>
    <target_env>production</target_env>
    <workspace_dir></workspace_dir>
    <database>
    <server></server>
    <user></user>
    <pwd></pwd>
    <name></name>
    <db_tls_enabled></db_tls_enabled>
    <db_tls_ca></db_tls_ca>
    <prefix></prefix>
    </database>
    <url>https://{{httpd_fqdn}}/</url>
    <graphviz_path>/usr/bin/dot</graphviz_path>
    <admin_account>
    <user></user>
    <pwd></pwd>
    <language></language>
    </admin_account>
    <language></language>
    <selected_modules type="array">
    <item>authent-cas</item>
    <item>authent-external</item>
    <item>authent-ldap</item>
    <item>authent-local</item>
    <item>combodo-backoffice-darkmoon-theme</item>
    <item>combodo-backoffice-fullmoon-high-contrast-theme</item>
    <item>combodo-backoffice-fullmoon-protanopia-deuteranopia-theme</item>
    <item>combodo-backoffice-fullmoon-tritanopia-theme</item>
    <item>itop-backup</item>
    <item>itop-config</item>
    <item>itop-files-information</item>
    <item>itop-portal-base</item>
    <item>itop-profiles-itil</item>
    <item>itop-sla-computation</item>
    <item>itop-structure</item>
    <item>itop-welcome-itil</item>
    <item>combodo-my-account</item>
    <item>itop-attribute-class-set</item>
    <item>itop-attribute-encrypted-password</item>
    <item>authent-token</item>
    <item>combodo-oauth2-client</item>
    <item>combodo-db-tools</item>
    <item>combodo-password-expiration</item>
    <item>combodo-webhook-integration</item>
    <item>itop-attachments</item>
    <item>itop-config-mgmt</item>
    <item>itop-core-update</item>
    <item>itop-hub-connector</item>
    <item>itop-oauth-client</item>
    <item>itop-themes-compat</item>
    <item>itop-tickets</item>
    <item>combodo-my-account-user-info</item>
    <item>itop-datacenter-mgmt</item>
    <item>itop-endusers-devices</item>
    <item>itop-storage-mgmt</item>
    <item>itop-virtualization-mgmt</item>
    <item>itop-bridge-cmdb-ticket</item>
    <item>itop-bridge-virtualization-storage</item>
    <item>itop-service-mgmt</item>
    <item>itop-bridge-cmdb-services</item>
    <item>itop-bridge-datacenter-mgmt-services</item>
    <item>itop-bridge-endusers-devices-services</item>
    <item>itop-bridge-storage-mgmt-services</item>
    <item>itop-bridge-virtualization-mgmt-services</item>
    <item>itop-request-mgmt</item>
    <item>itop-portal</item>
    <item>itop-change-mgmt</item>
    <item>itop-test</item>
    </selected_modules>
    <selected_extensions type="array">
    <item>itop-config-mgmt-core</item>
    <item>itop-config-mgmt-datacenter</item>
    <item>itop-config-mgmt-end-user</item>
    <item>itop-config-mgmt-storage</item>
    <item>itop-config-mgmt-virtualization</item>
    <item>itop-service-mgmt-enterprise</item>
    <item>itop-ticket-mgmt-simple-ticket</item>
    <item>itop-ticket-mgmt-simple-ticket-enhanced-portal</item>
    <item>itop-change-mgmt-simple</item>
    <item>itop-test</item>
    </selected_extensions>
    <sample_data></sample_data>
    <old_addon></old_addon>
    <mysql_bindir></mysql_bindir>
    </installation>

    I know there is a permission issue with copying the config-itop.php, I think I can fix that but i dont think that is the cause because it says "installed"
    
    I tried to remove env-production folder before hand and it does recreate that folder with my custom and i see the changes there but for whatever reason it still has does update the front end. Its as if it didn't even register there is a new extension
    

    The wizard though works perfectly.

     

    Last edit: franco 2025-12-10
  • franco

    franco - 2025-12-10

    okay i figured this out...

    sudo systemctl reload php-fpm

    that was it the whole time flushing the php-fpm cahce.. I though i did this in my script but i overlooked it.

    This works now.
    Thanks

     

Log in to post a comment.