generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The inventory plugin advertises support for caching, but the implementation was missing the required pieces to make it work properly. This commit split the inventory construction into two stages. The first stage is responsible for fetching remote data (interacting with the DigitalOcean's API). The second stage extracts the relevant data from the API responses and populated the inventory. Caching support then came almost for free. All we had to do is only fetch data if: 1. User does not want to use cache at all. 2. User does use cache and wants data refreshed. 3. User does use cache but the cache is empty. There is some additional logic that makes sure we write the data to cache if data refresh is requested, but nothing too complex.
- Loading branch information
Tadej Borovšak
committed
May 31, 2021
1 parent
e928762
commit fc7b4b8
Showing
3 changed files
with
32 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bugfixes: | ||
- digitalocean inventory plugin - wire up advertised caching functionality | ||
(https://github.com/ansible-collections/community.digitalocean/pull/97). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters