Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ansible local facts for OS-specific variables #7

Merged
merged 6 commits into from
Nov 14, 2024

Conversation

medanthelinium
Copy link
Contributor

@medanthelinium medanthelinium commented Nov 12, 2024

Currently, the PHP version variable is constructed dynamically depending on which PHP version is installed on the target system:

https://github.com/punktDe/ansible-proserver-php/blob/master/tasks/phpversion.yaml#L7-L20

Unfortunately, if this task is not ran explicitly (e.g. because of --start-at-task), the php_version variable will remain empty.

Moreover, with the recent change in the PHP service name on FreeBSD, we also need to construct the variable representing the PHP service dynamically, depending on the blueprint version.

Using ansible_local facts instead of a set_fact task ensures that the necessary variables are generated on the target system instead, and are available at any point in the playbook via ansible_local.php

Copy link
Member

@daniellienert daniellienert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good / didn't test

@medanthelinium medanthelinium merged commit 4e1df18 into master Nov 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants