From 416aaa295199373637e70e5c510e4f7cebed4baf Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Thu, 3 Oct 2024 21:16:58 -0400 Subject: [PATCH] install foreman and host requirements --- playbooks/install_foreman.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/playbooks/install_foreman.yml b/playbooks/install_foreman.yml index f8d4074..a591c4e 100644 --- a/playbooks/install_foreman.yml +++ b/playbooks/install_foreman.yml @@ -2,6 +2,9 @@ - name: installs foreman on redhat 9 hosts: foremanAlma become: yes + vars: + hostname: "foremanalma.homelab.local" + domain_name: "foremanalma.homelab.local" tasks: - name: clean all metadata ansible.builtin.command: dnf clean all @@ -14,3 +17,27 @@ - 'https://yum.puppet.com/puppet7-release-el-9.noarch.rpm' state: present disable_gpg_check: true + + - 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' + line: "127.0.0.1 {{hostname}}" + + + - name: Run the foreman installer + ansible.builtin.command: foreman-installer --scenario katello