You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Looking for ideas : managing nextcloud server configuration with ansible
#434
I'm exploring a way to manage both application and server configuration through an Ansible module.
However, using occ for this purpose feels a bit convoluted.
To ensure idempotency, the module needs a deterministic way to perform CRUD operations (create, read, update, delete), but so far I haven’t found a proper workflow for handling complex configuration structures.
There are two main challenges:
Lack of configuration consistency
Many external apps implement their configuration via occ in completely different ways.
This means the module cannot safely assume a common data structure or data type.
The results returned by the CLI depend on too many factors.
I’ve experimented with using the PSR-4 autoloader API within the server to read values and default configurations, but this feels more like a hack than a sustainable solution.
Handling complex data structures
Managing nested arrays or dictionaries often requires multiple occ calls, and sometimes even rewriting ordered arrays.
This is inefficient for automated workflows.
I also looked at occ config:import, but it isn't documented regarding expected JSON data structures and how CRUD operations are behaving.
Possible approaches
I’m currently evaluating a few options:
Option 1: Run a small PHP script directly from the Ansible module, bypassing occ.
This would allow applying all configuration changes in a single call, making it much faster.
Option 2: Create a dedicated class to manage configuration objects between Ansible and Nextcloud.
This would provide a cleaner abstraction, but it would be more complex to implement and slower to execute.
In both cases, this means adding more code that will require long-term maintenance.
What I’d like to discuss
Do you have any suggestions, ideas, or prior experiences on how to handle configuration management more cleanly in Nextcloud?
Any pointers to existing best practices or internal APIs would be very helpful.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello there!
I'm exploring a way to manage both application and server configuration through an Ansible module.
However, using
occfor this purpose feels a bit convoluted.To ensure idempotency, the module needs a deterministic way to perform CRUD operations (create, read, update, delete), but so far I haven’t found a proper workflow for handling complex configuration structures.
There are two main challenges:
Lack of configuration consistency
Many external apps implement their configuration via
occin completely different ways.This means the module cannot safely assume a common data structure or data type.
The results returned by the CLI depend on too many factors.
I’ve experimented with using the PSR-4 autoloader API within the server to read values and default configurations, but this feels more like a hack than a sustainable solution.
Handling complex data structures
Managing nested arrays or dictionaries often requires multiple
occcalls, and sometimes even rewriting ordered arrays.This is inefficient for automated workflows.
I also looked at
occ config:import, but it isn't documented regarding expected JSON data structures and how CRUD operations are behaving.Possible approaches
I’m currently evaluating a few options:
Option 1: Run a small PHP script directly from the Ansible module, bypassing
occ.This would allow applying all configuration changes in a single call, making it much faster.
Option 2: Create a dedicated class to manage configuration objects between Ansible and Nextcloud.
This would provide a cleaner abstraction, but it would be more complex to implement and slower to execute.
In both cases, this means adding more code that will require long-term maintenance.
What I’d like to discuss
Do you have any suggestions, ideas, or prior experiences on how to handle configuration management more cleanly in Nextcloud?
Any pointers to existing best practices or internal APIs would be very helpful.
References:
All reactions