From c1032f31e49ba27071cbc238f02c79bdc2f3cbf9 Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Fri, 3 Mar 2023 15:01:48 +0100 Subject: [PATCH] templates/packer/ansible: fix unregister The community redhat_subscription module calls `subscription-manager unsusbscribe`, which doesn't exist. Use shell for now. --- templates/packer/ansible/roles/common/tasks/main.yml | 4 ++-- .../packer/ansible/roles/common/tasks/unregister.yml | 8 ++++++++ .../packer/ansible/roles/common/tasks/unsubscribe.yml | 7 ------- 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 templates/packer/ansible/roles/common/tasks/unregister.yml delete mode 100644 templates/packer/ansible/roles/common/tasks/unsubscribe.yml diff --git a/templates/packer/ansible/roles/common/tasks/main.yml b/templates/packer/ansible/roles/common/tasks/main.yml index 9f1fccb1d..dbf762481 100644 --- a/templates/packer/ansible/roles/common/tasks/main.yml +++ b/templates/packer/ansible/roles/common/tasks/main.yml @@ -12,8 +12,8 @@ # Configure the worker. - include_tasks: worker-config.yml -# Unsubscribe -- include_tasks: unsubscribe.yml +# Unregister +- include_tasks: unregister.yml - name: Ensure SELinux contexts are updated command: restorecon -Rv /etc diff --git a/templates/packer/ansible/roles/common/tasks/unregister.yml b/templates/packer/ansible/roles/common/tasks/unregister.yml new file mode 100644 index 000000000..ba7acc23a --- /dev/null +++ b/templates/packer/ansible/roles/common/tasks/unregister.yml @@ -0,0 +1,8 @@ +--- + +- name: Unregister + become: yes + tags: + - subscribe + shell: >- + subscription-manager unregister diff --git a/templates/packer/ansible/roles/common/tasks/unsubscribe.yml b/templates/packer/ansible/roles/common/tasks/unsubscribe.yml deleted file mode 100644 index 90c2a3792..000000000 --- a/templates/packer/ansible/roles/common/tasks/unsubscribe.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- name: Unsubscribe - tags: - - subscribe - community.general.redhat_subscription: - state: absent