From f6d7e4533692f10e418c48131754497aa2b180ea Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sat, 15 Apr 2023 23:57:38 +0200 Subject: [PATCH] fixed handlers not applying netplan config --- handlers/main.yml | 4 +--- molecule/with_custom_config/group_vars/all.yml | 2 +- tasks/configure.yml | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 35fa9cc..5203b05 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,11 +4,9 @@ ansible.builtin.command: netplan generate changed_when: false listen: "netplan-generate" - notify: - - "netplan-apply" - name: "Apply netplan configuration" ansible.builtin.command: netplan apply - changed_when: false listen: "netplan-apply" + changed_when: false when: manage_netplan_apply diff --git a/molecule/with_custom_config/group_vars/all.yml b/molecule/with_custom_config/group_vars/all.yml index e30cfde..59074b4 100644 --- a/molecule/with_custom_config/group_vars/all.yml +++ b/molecule/with_custom_config/group_vars/all.yml @@ -4,7 +4,7 @@ manage_netplan_renderer: networkd # supported value is 'NetworkManager' or 'netw manage_netplan_remove_existing: false manage_netplan_search_domain: example.org manage_netplan_install: true -manage_netplan_apply: true +manage_netplan_apply: false manage_netplan_configuration: network: version: 2 diff --git a/tasks/configure.yml b/tasks/configure.yml index ac8f478..604c999 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -11,3 +11,4 @@ when: manage_netplan_configuration != [] notify: - "netplan-generate" + - "netplan-apply"