ansible – reregister RHEL playbook

---
- name: system subscription register
  hosts: rhel-9
  become: true

  tasks:
  - name: rhel subscription unregister
    community.general.redhat_subscription:
      state: "absent"
    command: subscription-manager remove --all
  - name: rhel subscription register
    community.general.redhat_subscription:
      state: present
      username: yourlogin
      password: "yourPass!"
      auto_attach: true
...

Leave a Reply

Your email address will not be published. Required fields are marked *