Skip to content

Fedora support #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions roles/tpa_single_node/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@
---
- name: Get IP of the current node
ansible.builtin.set_fact:
tpa_single_node_rhel_host: "{{ ansible_ssh_host }}"
# tpa_single_node_rhel_host: "{{ ansible_ssh_host }}"
tpa_single_node_rhel_host: "10.0.148.184"

- name: Set a variable about RHEL
ansible.builtin.set_fact:
rhel: false

- name: Set a variable if is a RHEL as expected
- name: Set rhel variable
ansible.builtin.set_fact:
rhel: true
when:
- ansible_facts['distribution'] == 'RedHat'
- ansible_facts['distribution_major_version'] == '9'
- (ansible_facts['distribution_version'] | split('.'))[1] | int >= 3

- name: Set a variable about fedora
ansible.builtin.set_fact:
fedora: false

- name: Set fedora variable
ansible.builtin.set_fact:
fedora: true
when:
- ansible_facts['distribution'] == 'Fedora'
- ansible_facts['distribution_major_version'] == '41' or
ansible_facts['distribution_major_version'] == '42'

- name: Install Operating System Components
ansible.builtin.include_tasks: os.yml
when: rhel
when:
- rhel
- fedora
args:
apply:
become: true

- name: Execute Podman Actions
ansible.builtin.include_tasks: podman.yml
when: rhel
when:
- rhel
- fedora
args:
apply:
become: true
Expand Down
3 changes: 2 additions & 1 deletion roles/tpa_single_node/tasks/os.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- name: Install System Packages dependencies
- name: Install System Packages dependencies for RHEL
ansible.builtin.package:
when: rhel
name: "{{ tpa_single_node_system_packages }}"
state: "present"
8 changes: 6 additions & 2 deletions roles/tpa_single_node/tasks/podman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
fail_msg: "tpa_single_node_registry_username doesn't exist, export the registry username and password"

- name: Podman login to registry.redhat.io
when: rhel
when:
- rhel
- fedora
ansible.builtin.command: podman login registry.redhat.io -u {{ tpa_single_node_registry_username }} -p {{ tpa_single_node_registry_password }}
register: podman_login_result
changed_when: '"Already logged in" not in podman_login_result'
Expand Down Expand Up @@ -44,7 +46,9 @@
changed_when: false

- name: Pull trustification image from registry.redhat.io
when: rhel
when:
- rhel
- fedora
ansible.builtin.command:
cmd: "podman pull {{ tpa_single_node_trustification_image }}"
changed_when: false