Files
product-demos/linux/ec2_register.yml
willtome efcf729fa0 Instruqt Refactor (#40)
* work on landing page

* work on landing page

* work on landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* landing page

* add files

* derp

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add link

* add ee

* add ee

* add ee

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* fix landing page

* remove commented out sections

* remove default ee

* set local admin password

* set ee for fact scan

* fall back to default ee for patching

* check for valid org_id

* check for valid org_id

* check admin username

* add remote_user

* credssp

* ntlm
2022-11-10 15:52:13 -05:00

72 lines
1.7 KiB
YAML

---
- hosts: "{{ HOSTS }}"
become: yes
tasks:
- name: check for vars
assert:
that:
- org_id is defined
- activation_key is defined
- org_id != ''
- activation_key != ''
- org_id != 'undef'
- activation_key != 'undef'
- name: set hostname
hostname:
name: "{{ inventory_hostname | regex_replace('_','-')}}"
- name: remove rhui client packages
yum:
name: rh-amazon-rhui-client*
state: removed
- name: get current repos
command:
cmd: ls /etc/yum.repos.d/
register: repos
changed_when: False
- name: remove existing rhui repos
file:
path: "/etc/yum.repos.d/{{ item }}"
state: absent
loop: "{{ repos.stdout_lines }}"
when: "'rhui' in item"
- name: install katello package
yum:
name: "https://{{ sat_url }}/pub/katello-ca-consumer-latest.noarch.rpm"
state: present
validate_certs: no
when: sat_url is defined
- name: manage repos with subscription mangler
ansible.builtin.lineinfile:
path: /etc/rhsm/rhsm.conf
regexp: '^manage_repos'
line: 'manage_repos = 1'
- name: register subscription mangler
community.general.redhat_subscription:
state: present
activationkey: "{{ activation_key }}"
org_id: "{{ org_id }}"
- name: disable htb repo
community.general.rhsm_repository:
name: rhel-7-server-htb*
state: disabled
ignore_errors: yes
- name: configure Red Hat insights
import_role:
name: redhat.insights.insights_client
vars:
insights_display_name: "{{ inventory_hostname }}"
insights_tags:
env: "{{ env }}"
purpose: demo
group: "{{ ansible_group }}"