If you have not already cleaned up from an out of disk space condition in your Automate system, please start here Chef Automate 2 degraded performance or disk full due to too much historical data
In order to give our Automate 2 system the room that it needs to perform, we need to set our data retention levels as low as makes sense for our needs. With a couple hundred chef-client nodes sending reports to a single node Automate instance, you can keep a lot of historical data. Maybe up to 100+ days. To increase the number of retained days of history, reduce the number of compliance profile runs per day to a single run. More infrequent is better when your goal is to increase data retention.
- Generate or use an existing admin token. You will want to export as the example
shows https://docs.chef.io/automate/api_tokens/#admin-tokens or, if
you already have an admin token, you can reuse that token content.
- Grab the config example at https://docs.chef.io/automate/data_lifecycle/#configuration and save on your Automate system in a file called config.json
- Modify the config example so that all older_than_days are set to 14 or less
- Apply the config using your admin token and this command line. You will need to change the example FQDN to the one used for your Automate system:
curl -sS -H "api-token: $TOKEN" -X PUT --data "@config.json" https://automate.example.com/api/v0/data-lifecycle/config
- Monitor for a few days to ensure config took effect. If older_than_days is set to 14, you should not see any data 15 days old or older after the automatic cleanup. Cleanup for the major things like chef-client converge history and compliance profile run history happens on a daily schedule