Module - tripleo_diff_exec¶
This module provides for the following ansible plugin:
tripleo_diff_exec
Module Documentation¶
Takes a file path and compares it to a previous version (created by this module) and runs a command if the contents are different.
Options¶
- command
Command to run if the state file has changed since the last run. If the previous version of the state file does not exist, the command is run.
- environment
Environment variables to be passed to the command being run
- return_codes
List of valid return code values for the command
- state_file
File to use to compare to the previous version
- state_file_suffix
Suffix to use to store the previous version of the file for comparisons between runs
Authors¶
Alex Schultz (@mwhahaha)
Example Tasks¶
- name: Run command if file is changed
tripleo_diff_exec:
command: systemctl restart foo.service
state_file: /var/lib/my-file
state_file_suffix: -foo
environment:
FOO: bar