2024-10-03 23:33:09 +00:00
|
|
|
---
|
|
|
|
- name: installs foreman on redhat 9
|
|
|
|
hosts: foremanAlma
|
|
|
|
become: yes
|
2024-10-04 01:16:58 +00:00
|
|
|
vars:
|
|
|
|
hostname: "foremanalma.homelab.local"
|
|
|
|
domain_name: "foremanalma.homelab.local"
|
2024-10-03 23:33:09 +00:00
|
|
|
tasks:
|
|
|
|
- name: clean all metadata
|
|
|
|
ansible.builtin.command: dnf clean all
|
|
|
|
|
|
|
|
- name: clear any metadata
|
|
|
|
ansible.builtin.dnf:
|
|
|
|
name:
|
|
|
|
- 'https://yum.theforeman.org/releases/3.12/el9/x86_64/foreman-release.rpm'
|
|
|
|
- 'https://yum.theforeman.org/katello/4.14/katello/el9/x86_64/katello-repos-latest.rpm'
|
|
|
|
- 'https://yum.puppet.com/puppet7-release-el-9.noarch.rpm'
|
|
|
|
state: present
|
|
|
|
disable_gpg_check: true
|
2024-10-04 01:16:58 +00:00
|
|
|
|
|
|
|
- name: Upgrade all packages
|
|
|
|
ansible.builtin.dnf:
|
|
|
|
name: "*"
|
|
|
|
state: latest
|
|
|
|
|
|
|
|
- name: install foreman-installer-katello
|
|
|
|
ansible.builtin.dnf:
|
|
|
|
name: foreman-installer-katello
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: set hostname
|
|
|
|
ansible.builtin.hostname:
|
|
|
|
name: "{{hostname}}"
|
|
|
|
|
|
|
|
- name: Ensure SELinux is set to enforcing mode
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
path: /etc/hosts
|
|
|
|
regexp: '^127.0.0.1'
|
2024-10-05 16:15:57 +00:00
|
|
|
line: "127.0.0.1 {{hostname}} localhost"
|
2024-10-04 01:16:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
- name: Run the foreman installer
|
|
|
|
ansible.builtin.command: foreman-installer --scenario katello
|