From 2ae89a09527b75eedd10a92adc3ca2e153d6ca9b Mon Sep 17 00:00:00 2001 From: Chris Croome <chris@webarchitects.co.uk> Date: Mon, 16 Oct 2023 19:45:42 +0100 Subject: [PATCH] internal variables added to arg spec --- meta/argument_specs.yml | 8 ++++++++ tasks/conf_section_edited.yml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml index 9b27426..f7d9532 100644 --- a/meta/argument_specs.yml +++ b/meta/argument_specs.yml @@ -65,6 +65,14 @@ argument_specs: elements: str required: false description: Internal list of proposed MariaDB configuration file variables that don't have values. + mariadb_cnf_variable_edited: + type: dict + required: false + description: Internal results from using ini_file to write a variable variable in a config file. + mariadb_cnf_variable_uncommented: + type: dict + required: false + description: Internal results from using lineinfile to uncomment a variable in a config file. mariadb_config: type: list elements: dict diff --git a/tasks/conf_section_edited.yml b/tasks/conf_section_edited.yml index 93027a9..f4f3978 100644 --- a/tasks/conf_section_edited.yml +++ b/tasks/conf_section_edited.yml @@ -80,7 +80,7 @@ mode: "{{ mariadb_cnf.mode | default('0644') }}" owner: "{{ mariadb_cnf.owner | default('root') }}" group: "{{ mariadb_cnf.owner | default('root') }}" - register: mariadb_conf_variable_uncommented + register: mariadb_cnf_variable_uncommented when: >- ( mariadb_cnf_variable_pair.key not in mariadb_cnf_file_section_existing_keys ) or ( ( mariadb_cnf_variable_pair.value | type_debug != "NoneType" ) and @@ -98,9 +98,9 @@ msg: MariaDB is to be restarted notify: Restart mariadb when: - - mariadb_conf_variable_uncommented is defined - - mariadb_conf_variable_uncommented.changed is defined - - mariadb_conf_variable_uncommented.changed | bool + - mariadb_cnf_variable_uncommented is defined + - mariadb_cnf_variable_uncommented.changed is defined + - mariadb_cnf_variable_uncommented.changed | bool - mariadb_init is defined - mariadb_init == "systemd" @@ -114,7 +114,7 @@ mode: "{{ mariadb_cnf.mode | default('0644') }}" owner: "{{ mariadb_cnf.owner | default('root') }}" group: "{{ mariadb_cnf.owner | default('root') }}" - register: mariadb_conf_variable_edited + register: mariadb_cnf_variable_edited when: - mariadb_cnf_variable_pair.key in mariadb_cnf_file_section_proposed_value_less_keys - mariadb_cnf_variable_pair.key not in mariadb_cnf_file_section_existing_keys @@ -130,9 +130,9 @@ msg: MariaDB is to be restarted notify: Restart mariadb when: - - mariadb_conf_variable_edited is defined - - mariadb_conf_variable_edited.changed is defined - - mariadb_conf_variable_edited.changed | bool + - mariadb_cnf_variable_edited is defined + - mariadb_cnf_variable_edited.changed is defined + - mariadb_cnf_variable_edited.changed | bool - mariadb_init is defined - mariadb_init == "systemd" -- GitLab