Add "maybe" commands
Sometimes it is not possible to determine the remote state during the fact gathering phase, which leads to the interdependent operations issue. As a workaround pyinfra already uses quick scripts to dynamically handle such situations in some cases:
- https://github.com/Fizzadar/pyinfra/blob/master/pyinfra/operations/init.py#L27
- https://github.com/Fizzadar/pyinfra/blob/master/pyinfra/operations/files.py#L276
A "maybe" command would behave the same but be flagged as "might run" in the proposed changes after fact gathering. This logic could then be applied to the files.[line|directory|file] operations to remove/replace the assume_present argument, which is a far greater user experience.
There are not many operations affected by this issue anymore, and this should remove the issue entirely from the users perspective.
Up-to-date link to interdependent operations (link in the first post is broken): https://docs.pyinfra.com/en/2.x/deploy-process.html#interdependent-operations
v3 implements this properly "maybe will change" operations and indicated in the pre-apply changes output.