| --- |
| # php molecule/default/verify.yml |
| # |
| # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| - name: Verify |
| hosts: all |
| vars: |
| nginx_static_dir: "/srv/sites/" |
| tasks: |
| |
| # Test PHP-FPM |
| - name: Create a php test file |
| copy: |
| dest: "{{ nginx_static_dir }}/php.example.com/example.php" |
| mode: 0644 |
| content: "<?php var_export($_SERVER)?>" |
| |
| - name: Retrieve php script output |
| uri: |
| url: http://127.0.0.1/example.php |
| headers: |
| Host: "php.example.com" |
| status_code: 200 |
| return_content: true |
| register: webpagephp |
| failed_when: "'SCRIPT_FILENAME' not in webpagephp.content" |
| |
| - name: Display php script output |
| debug: |
| var: webpagephp |
| |
| - name: Delete php test file |
| file: |
| path: "{{ nginx_static_dir }}/php.example.com/example.php" |
| state: absent |