From 967102bc4f2e82eca76032a2dad36aa30303b45e Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 13 Dec 2018 07:34:29 -0600 Subject: [PATCH] easier way to disable cloud-init --- roles/network/tasks/netplan.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/roles/network/tasks/netplan.yml b/roles/network/tasks/netplan.yml index 2bd0f67e8..903312856 100644 --- a/roles/network/tasks/netplan.yml +++ b/roles/network/tasks/netplan.yml @@ -6,15 +6,19 @@ # Think 50-cloud-init.yaml is created on the fly by cloud-init on every boot # need to double check the timestamps of the file on a rebooted machine # disable cloud-init if that holds true -- name: Disable and mask cloud-init - systemd: - name: "{{ item }}" - enabled: no - masked: yes - state: stopped - with_items: - - cloud-init-local - - cloud-init +#- name: Disable and mask cloud-init +# systemd: +# name: "{{ item }}" +# enabled: no +# masked: yes +# state: stopped +# with_items: +# - cloud-init-local +# - cloud-init +# when: "{{ netplan }}" == "50-cloud-init.yaml" + +- name: Disable cloud-init + shell: touch /etc/cloud/cloud-init.disabled when: "{{ netplan }}" == "50-cloud-init.yaml" - name: Remove stock netplan template