From aa273fdcbb91b3e521fdf315c11a304b3a70e58c Mon Sep 17 00:00:00 2001 From: Sebastien Thebert Date: Sun, 30 Oct 2022 01:50:30 +0200 Subject: [PATCH] Minor fixes --- meta/argument_specs.yml | 2 +- tasks/unregister.yml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml index 213c565..8222326 100644 --- a/meta/argument_specs.yml +++ b/meta/argument_specs.yml @@ -31,7 +31,7 @@ argument_specs: - 'fips' - 'fips-updates' - 'livepatch' # Canonical Kernel Livepatch - - 'usg' + - 'usg' state: description: State of Ubuntu Pro installation type: str diff --git a/tasks/unregister.yml b/tasks/unregister.yml index 6027e28..c9a1e97 100644 --- a/tasks/unregister.yml +++ b/tasks/unregister.yml @@ -1,9 +1,11 @@ --- -- ansible.builtin.shell: "command pro" +- name: Check if command 'pro' exists + ansible.builtin.shell: "command pro" register: reg_command_pro ignore_errors: yes -- set_fact: +- name: Set variable 'pro_command_exists' + ansible.builtin.set_fact: pro_command_exists: "{{ (reg_command_pro.rc == 127) | ternary(false, true) }}" - name: Unregister this host on Ubuntu Pro (pro detach)