diff --git a/defaults/main.yml b/defaults/main.yml index c33107c7fbb573126b65c20f273c1a45f1c74871..70affadfc1e6492f8d5b171c68a49e3c10a48907 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,14 +4,14 @@ php_dpkg: /usr/bin/dpkg php_phpquery: /usr/sbin/phpquery php_versions: '8.1': - state: absent + state: present sapis: apache2: state: absent cli: state: present fpm: - state: present + state: absent phpdbg: state: absent '8.0': diff --git a/tasks/absent.yml b/tasks/absent.yml index 65659e67c00e4af466aeb0d7ddf95d3f9a9d034e..125a8e2b79550ad93ac23afe596e238955a5d1dd 100644 --- a/tasks/absent.yml +++ b/tasks/absent.yml @@ -6,12 +6,22 @@ apt: pkg: "php{{ version }}*" state: absent + purge: true autoclean: true autoremove: true loop: "{{ php_versions_remove }}" loop_control: loop_var: version - label: "php{{ version }}" + label: "{{ version }}" + + - name: PHP config files absent + file: + path: "/etc/php/{{ version }}/" + state: absent + loop: "{{ php_versions_remove }}" + loop_control: + loop_var: version + label: "{{ version }}" tags: - php diff --git a/tasks/checks.yml b/tasks/checks.yml index fe1fe90b0ce0d47fbc27440c518ec89d0208ebe5..e26ba2acfa4464dfe0b5bdb2d404d01f56e3413e 100644 --- a/tasks/checks.yml +++ b/tasks/checks.yml @@ -2,6 +2,9 @@ - name: PHP checks block: + # TODO + # - Check that when a version SAPI is set to present the version is also set to present + # - Check that when a version is set to absent the SAPIs are also set to absent, if the state is set - name: Check that depreciated variables are not used assert: that: