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)