ssg.ansible module
Common functions for processing Ansible in SSG
- ssg.ansible.add_minimum_version(ansible_src)[source]
Adds a minimum Ansible version requirement to an Ansible script.
This function inserts a pre_task into the provided Ansible script to assert that the Ansible version is greater than or equal to a specified minimum version. If the script already contains a pre_task or the version check, it will return the original script. If a pre_task exists but does not contain the version check, it raises a ValueError.
- Args:
ansible_src (str): The source code of the Ansible script.
- Returns:
str: The modified Ansible script with the minimum version requirement added.
- Raises:
- ValueError: If a pre_task already exists in the Ansible script but does not
contain the version check.