ansible-role-redhat-subscri.../tasks/main.yml

34 lines
758 B
YAML

- name: Check that this is Red Hat
assert:
that: "ansible_distribution == 'RedHat'"
tags:
- rhsub
- name: Configure Red Hat subscirption manager
template:
src: rhsm.conf.j2
dest: /etc/rhsm/rhsm.conf
owner: root
group: root
mode: 0644
tags:
- rhsub
- rhsub_rhsm
- name: Manage Red Hat subscription
redhat_subscription:
username: "{{ rhn_username }}"
password: "{{ rhn_password }}"
state: "{{ rhsub_state }}"
autosubscribe: "{{ rhsub_autosubscribe }}"
tags:
- rhsub
- rhsub_register
- name: Configure repository subscriptions
command: subscription-manager repos --{{ item.state }} {{ item.name }}
with_items: "{{ rhsub_repos | default([]) }}"
tags:
- rhsub
- rhsub_repos