diff --git a/defaults/main.yml b/defaults/main.yml
index 35a381f5042351b11aa626bb49177931dfdb7b1c..a81fa14a57b6eb9b1646b9fdc5248168df272692 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -124,6 +124,11 @@ php_config:
     version: "8.2"
     state: present
     files:
+      - name: PHP 8.2 JIT configuration
+        path: /etc/php/8.1/mods-available/opcache.ini
+        state: edited
+        conf_absent:
+          "opcache.jit": "off"
       - name: PHP 8.2 CLI configuration
         path: /etc/php/8.2/cli/php.ini
         state: present
@@ -228,6 +233,11 @@ php_config:
     version: "8.1"
     state: present
     files:
+      - name: PHP 8.1 JIT configuration
+        path: /etc/php/8.1/mods-available/opcache.ini
+        state: edited
+        conf_absent:
+          "opcache.jit": "off"
       - name: PHP 8.1 CLI configuration
         path: /etc/php/8.1/cli/php.ini
         state: present
@@ -332,6 +342,11 @@ php_config:
     version: "8.0"
     state: present
     files:
+      - name: PHP 8.0 JIT configuration
+        path: /etc/php/8.0/mods-available/opcache.ini
+        state: edited
+        conf_absent:
+          "opcache.jit": "off"
       - name: PHP 8.0 CLI configuration
         path: /etc/php/8.0/cli/php.ini
         state: present
diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml
index 6c1f8fd5ff675a12a388df155be45a70b79fd074..6a26e591fd61b45db71276329964642951b2641a 100644
--- a/meta/argument_specs.yml
+++ b/meta/argument_specs.yml
@@ -96,7 +96,11 @@ argument_specs:
               conf:
                 type: dict
                 required: false
-                description: A optional YAML dictionary representing the sections, variables and values of a PHP configuration file.
+                description: A optional YAML dictionary representing the sections, variables and values of a PHP configuration file that sould be present.
+              conf_absent:
+                type: dict
+                required: false
+                description: A optional YAML dictionary representing the sections, variables and values of a PHP configuration file that should be absent.
               name:
                 type: str
                 required: false
diff --git a/tasks/file_edited.yml b/tasks/file_edited.yml
index 1ce53dc330dd0cdfe18874d62bad34c799a895d3..9f3cfa74f810f1ed08f2f602fefe3c4681374786 100644
--- a/tasks/file_edited.yml
+++ b/tasks/file_edited.yml
@@ -19,16 +19,37 @@
     - name: Set a fact for the existing PHP configuration file variables
       ansible.builtin.set_fact:
         php_conf_file_existing_vars: "{{ php_conf_file_b64encoded['content'] | ansible.builtin.b64decode | community.general.jc('ini') }}"
+        php_conf_file_no_extra_spaces: "{%- if (php_conf_file | ansible.builtin.dirname | ansible.builtin.split('/') | last) == 'mods-available' -%}true{%- else -%}false{%- endif -%}"
 
     - name: Debug the existing PHP configuration file variables
       ansible.builtin.debug:
         var: php_conf_file_existing_vars
         verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
 
+    - name: Debug the PHP configuration no extra spaces variable
+      ansible.builtin.debug:
+        var: php_conf_file_no_extra_spaces
+        verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
+
+    - name: Set a fact to indicate that the existing PHP configuration file has sections
+      ansible.builtin.set_fact:
+        php_conf_file_existing_sections: >-
+          {%- if (php_conf_file_existing_vars |
+          ansible.builtin.json_query('*[]') |
+          map('ansible.builtin.type_debug') |
+          unique)[0] == "dict"
+          -%}true{%- else -%}false{%- endif -%}
+
+    - name: Debug the existing PHP configuration file sections variables
+      ansible.builtin.debug:
+        var: php_conf_file_existing_sections
+        verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
+
     - name: Debug the existing PHP configuration file sections
       ansible.builtin.debug:
         var: php_conf_file_existing_vars.keys()
         verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
+      when: php_conf_file_existing_sections | bool
 
     - name: Set a fact for the proposed PHP configuration file variables
       ansible.builtin.set_fact:
@@ -41,10 +62,42 @@
         var: php_conf_file_proposed_vars
         verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
 
+    - name: Set a fact for the absent PHP configuration file variables
+      ansible.builtin.set_fact:
+        php_conf_file_absent_vars: "{{ php_config | community.general.json_query(php_conf_file_absent_vars_json_query) }}"
+      vars:
+        php_conf_file_absent_vars_json_query: "[?state=='present'].files[]|[?path=='{{ php_conf_file }}'].conf_absent|[0]"
+
+    - name: Debug the absent PHP configuration file variables
+      ansible.builtin.debug:
+        var: php_conf_file_absent_vars
+        verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
+
+    - name: Set a fact to indicate that the proposed PHP configuration file has sections
+      ansible.builtin.set_fact:
+        php_conf_file_proposed_sections: >-
+          {%- if (php_conf_file_proposed_vars |
+          ansible.builtin.json_query('*[]') |
+          map('ansible.builtin.type_debug') |
+          unique)[0] == "dict"
+          -%}true{%- else -%}false{%- endif -%}
+
+    - name: Debug the proposed PHP configuration file sections variables
+      ansible.builtin.debug:
+        var: php_conf_file_proposed_sections
+        verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
+
     - name: Debug the proposed PHP configuration file sections
       ansible.builtin.debug:
         var: php_conf_file_proposed_vars.keys()
         verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
+      when: php_conf_file_proposed_sections | bool
+
+    - name: Ensure that when the existing files has sections and proposed config also has sections
+      ansible.builtin.assert:
+        that:
+          - php_conf_file_existing_sections == php_conf_file_proposed_sections
+        quiet: "{% if ansible_verbosity == 0 %}true{% else %}false{% endif %}"
 
     - name: Set facts for the PHP configuration file
       ansible.builtin.set_fact:
@@ -68,11 +121,6 @@
         var: php_conf_file_version
         verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
 
-    - name: Debug the proposed PHP configuration file sections
-      ansible.builtin.debug:
-        var: php_conf_file_proposed_vars.keys()
-        verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
-
     - name: File backup present
       ansible.builtin.copy:
         src: "{{ php_conf_file }}"
@@ -83,13 +131,68 @@
         group: root
       changed_when: false
 
+    - name: Edit the section-less PHP configuration file
+      community.general.ini_file:
+        path: "{{ php_conf_file }}"
+        option: "{{ php_conf_pair.key }}"
+        value: "{{ php_conf_pair.value }}"
+        state: present
+        modify_inactive_option: true
+        no_extra_spaces: "{{ php_conf_file_no_extra_spaces }}"
+        mode: "0644"
+        owner: root
+        group: root
+      loop: "{{ php_conf_file_proposed_vars | ansible.builtin.dict2items }}"
+      loop_control:
+        loop_var: php_conf_pair
+        label: "{{ php_conf_pair.key }}"
+      when:
+        - php_conf_file_proposed_vars is defined
+        - php_conf_file_proposed_vars | ansible.builtin.dict2items | length > 0
+        - not php_conf_file_existing_sections | bool
+        - not php_conf_file_proposed_sections | bool
+
+    - name: Remove config from the section-less PHP configuration file
+      community.general.ini_file:
+        path: "{{ php_conf_file }}"
+        option: "{{ php_conf_pair.key }}"
+        state: absent
+        mode: "0644"
+        owner: root
+        group: root
+      loop: "{{ php_conf_file_absent_vars | ansible.builtin.dict2items }}"
+      loop_control:
+        loop_var: php_conf_pair
+        label: "{{ php_conf_pair.key }}"
+      when:
+        - php_conf_file_absent_vars is defined
+        - php_conf_file_absent_vars | ansible.builtin.dict2items | length > 0
+        - not php_conf_file_existing_sections | bool
+        - not php_conf_file_proposed_sections | bool
+
     - name: Include the PHP configuration file section edited tasks
       ansible.builtin.include_tasks: file_section_edited.yml
-      loop: "{{ php_conf_file_proposed_vars | dict2items }}"
+      loop: "{{ php_conf_file_proposed_vars | ansible.builtin.dict2items }}"
       loop_control:
         loop_var: php_conf_section
         label: "{{ php_conf_section.key }}"
-      when: php_conf_file_proposed_vars.keys() | length != 0
+      when:
+        - php_conf_file_proposed_vars is defined
+        - php_conf_file_proposed_vars | ansible.builtin.dict2items | length > 0
+        - php_conf_file_existing_sections | bool
+        - php_conf_file_proposed_sections | bool
+
+    - name: Include the PHP configuration file config absent tasks
+      ansible.builtin.include_tasks: file_section_absent.yml
+      loop: "{{ php_conf_file_absent_vars | ansible.builtin.dict2items }}"
+      loop_control:
+        loop_var: php_conf_section
+        label: "{{ php_conf_section.key }}"
+      when:
+        - php_conf_file_absent_vars is defined
+        - php_conf_file_absent_vars | ansible.builtin.dict2items | length > 0
+        - php_conf_file_existing_sections | bool
+        - php_conf_file_proposed_sections | bool
 
     - name: Ansible managed comment present at the top of the file
       ansible.builtin.lineinfile:
diff --git a/tasks/file_section_absent.yml b/tasks/file_section_absent.yml
new file mode 100644
index 0000000000000000000000000000000000000000..88bd0dc2d068d34f2831c7c10a45e92bc10ecb86
--- /dev/null
+++ b/tasks/file_section_absent.yml
@@ -0,0 +1,57 @@
+# Copyright 2019-2024 Chris Croome
+#
+# This file is part of the Webarchitects PHP Ansible role.
+#
+# The Webarchitects PHP Ansible role is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+#
+# The Webarchitects PHP Ansible role is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with the Webarchitects PHP Ansible role. If not, see <https://www.gnu.org/licenses/>.
+---
+- name: PHP configuration file section config absent
+  block:
+
+    - name: Debug the absent PHP configuration file variables
+      ansible.builtin.debug:
+        msg:
+          - "File: {{ php_conf_file }}"
+          - "Section: {{ php_conf_section.key }}"
+          - "Absent {{ php_conf_variable_pair.key }}"
+        verbosity: "{% if ansible_check_mode | bool or ansible_diff_mode | bool %}0{% else %}1{% endif %}"
+      when: php_conf_variable_pair.value != php_conf_file_existing_vars | community.general.json_query(php_conf_variable_json_query)
+      vars:
+        php_conf_variable_json_query: '"{{ php_conf_section.key }}"."{{ php_conf_variable_pair.key }}"'
+      loop: "{{ php_conf_section.value | ansible.builtin.dict2items }}"
+      loop_control:
+        loop_var: php_conf_variable_pair
+        label: "{{ php_conf_variable_pair.key }}"
+
+    - name: PHP configuration variables absent
+      community.general.ini_file:
+        path: "{{ php_conf_file }}"
+        section: "{{ php_conf_section.key }}"
+        option: "{{ php_conf_variable_pair.key }}"
+        state: absent
+        mode: "0644"
+        owner: root
+        group: root
+      when: php_conf_variable_pair.value != php_conf_file_existing_vars | community.general.json_query(php_conf_variable_json_query)
+      vars:
+        php_conf_variable_json_query: '"{{ php_conf_section.key }}"."{{ php_conf_variable_pair.key }}"'
+      loop: "{{ php_conf_section.value | ansible.builtin.dict2items }}"
+      loop_control:
+        loop_var: php_conf_variable_pair
+        label: "{{ php_conf_variable_pair.key }}"
+      register: php_conf_file_edited
+
+    - name: Set a fact to indicate that the file has changed  # noqa: no-handler
+      ansible.builtin.set_fact:
+        php_conf_file_changed: true
+      # when: (php_conf_file_comments_edited.changed ) or ( php_conf_file_edited.changed | bool )
+      when: php_conf_file_edited.changed | bool
+
+  tags:
+    - php
+    - php_cfg
+    - php_conf
+...
diff --git a/tasks/file_section_edited.yml b/tasks/file_section_edited.yml
index 2fb44690d6c74eb53528656717d9962139d5f81d..ca7078f9a26594e3012af852cb98ed598213e363 100644
--- a/tasks/file_section_edited.yml
+++ b/tasks/file_section_edited.yml
@@ -54,8 +54,9 @@
         section: "{{ php_conf_section.key }}"
         option: "{{ php_conf_variable_pair.key }}"
         value: "{{ php_conf_variable_pair.value }}"
+        state: present
         modify_inactive_option: true
-        no_extra_spaces: false
+        no_extra_spaces: "{{ php_conf_file_no_extra_spaces }}"
         mode: "0644"
         owner: root
         group: root
diff --git a/tasks/file_templated.yml b/tasks/file_templated.yml
index cd2543306f89dc4c22359814308701b3ee6eefc3..a19e70e074fff2ebbaa5afd7c3807c1fdf82892a 100644
--- a/tasks/file_templated.yml
+++ b/tasks/file_templated.yml
@@ -14,6 +14,7 @@
     - name: Set facts for the PHP configuration file
       ansible.builtin.set_fact:
         php_conf_file_backup: "{{ php_conf_file | ansible.builtin.dirname }}/.{{ php_conf_file | ansible.builtin.basename }}.{{ ansible_date_time.iso8601_basic_short }}.bak"
+        php_conf_file_no_extra_spaces: "{%- if (php_conf_file | ansible.builtin.dirname | ansible.builtin.split('/') | last) == 'mods-available' -%}true{%- else -%}false{%- endif -%}"
         php_conf_file_proposed_vars: "{{ php_config | community.general.json_query(php_conf_file_proposed_vars_json_query) }}"
         php_conf_file_sapi: "{{ php_conf_file | ansible.builtin.split(php_file_path_separator) | community.general.json_query('[4]') }}"
         php_conf_file_version: "{{ php_conf_file | ansible.builtin.split(php_file_path_separator) | community.general.json_query('[3]') }}"
@@ -25,6 +26,11 @@
         var: php_conf_file_backup
         verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
 
+    - name: Debug the PHP configuration no extra spaces variable
+      ansible.builtin.debug:
+        var: php_conf_file_no_extra_spaces
+        verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
+
     - name: Debug the PHP configuration file PHP SAPI
       ansible.builtin.debug:
         var: php_conf_file_sapi
@@ -40,10 +46,25 @@
         var: php_conf_file_proposed_vars
         verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
 
+    - name: Set a fact to indicate that the proposed PHP configuration file has sections
+      ansible.builtin.set_fact:
+        php_conf_file_proposed_sections: >-
+          {%- if (php_conf_file_proposed_vars |
+          ansible.builtin.json_query('*[]') |
+          map('ansible.builtin.type_debug') |
+          unique)[0] == "dict"
+          -%}true{%- else -%}false{%- endif -%}
+
+    - name: Debug the proposed PHP configuration file sections variables
+      ansible.builtin.debug:
+        var: php_conf_file_proposed_sections
+        verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
+
     - name: Debug the proposed PHP configuration file sections
       ansible.builtin.debug:
         var: php_conf_file_proposed_vars.keys()
         verbosity: "{% if ansible_check_mode | bool %}1{% else %}2{% endif %}"
+      when: php_conf_file_proposed_sections | bool
 
     - name: File backup present
       ansible.builtin.copy:
diff --git a/templates/php.j2 b/templates/php.j2
index 4ed0359f4c9b4d8dba13e36fabce9db4e8308f99..918488efb4eafb845f1b9f0f7ab4de98cc374599 100644
--- a/templates/php.j2
+++ b/templates/php.j2
@@ -1,11 +1,24 @@
 ; {{ ansible_managed }}
-; {# j2lint: disable=jinja-statements-indentation #}
 
-{% for php_section in php_conf_file_proposed_vars | dict2items %}
+{% if php_conf_file_proposed_sections | bool %}
+{%     for php_section in php_conf_file_proposed_vars | dict2items %}
 [{{ php_section.key }}]
-{% for php_variable_pair in php_section.value | dict2items %}
+{%         for php_variable_pair in php_section.value | dict2items %}
+{%             if php_conf_file_no_extra_spaces | bool %}
+{{ php_variable_pair.key }}={{ php_variable_pair.value }}
+{%             else %}
 {{ php_variable_pair.key }} = {{ php_variable_pair.value }}
-{% endfor %}
-{% endfor %}
+{%             endif %}
+{%         endfor %}
+{%     endfor %}
+{% else %}
+{%     for php_conf_pair in php_conf_file_proposed_vars | ansible.builtin.dict2items %}
+{%         if php_conf_file_no_extra_spaces | bool %}
+{{ php_conf_pair.key }}={{ php_conf_pair.value }}
+{%         else %}
+{{ php_conf_pair.key }} = {{ php_conf_pair.value }}
+{%         endif %}
+{%     endfor %}
+{% endif %}
 
 ; vim: syntax=dosini