Skip to content

Commit 0eff6f5

Browse files
author
Anurag Guda
authored
25.4.0 gcc fix
Merge pull request #108 from angudadevops/25.4.0
2 parents 769ae10 + 7900d29 commit 0eff6f5

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

playbooks/prerequisites.yaml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,52 @@
107107
register: add_rhel_repo
108108
until: add_rhel_repo is succeeded
109109

110+
111+
- name: check update GCC for build essentials
112+
when: "ansible_distribution == 'Ubuntu'"
113+
become: true
114+
block:
115+
- name: capture gcc expected version
116+
shell: cat /proc/version | tr -d '(' | tr -d ')' | awk '{print $8}' | cut -d '.' -f 1
117+
register: gcc_expected_version
118+
119+
- name: install expected gcc version
120+
apt:
121+
name: "gcc-{{ gcc_expected_version.stdout }}"
122+
state: present
123+
124+
- name: install expected g++ version
125+
apt:
126+
name: "g++-{{ gcc_expected_version.stdout }}"
127+
state: present
128+
129+
- name: capture gcc binary path
130+
shell: "which gcc"
131+
register: gcc_bin_path
132+
133+
- name: capture g++ binary path
134+
shell: "which g++"
135+
register: g_plus_plus_bin_path
136+
137+
- name: capture gcc expected version binary path
138+
shell: "which gcc-{{ gcc_expected_version.stdout }}"
139+
register: gcc_expected_version_bin_path
140+
141+
- name: capture g++ expected version binary path
142+
shell: "which g++-{{ gcc_expected_version.stdout }}"
143+
register: g_plus_plus_expected_version_bin_path
144+
145+
- name: setup expected gcc as primary gcc
146+
community.general.alternatives:
147+
name: gcc
148+
link: "{{ gcc_bin_path.stdout }}"
149+
path: "{{ gcc_expected_version_bin_path.stdout }}"
150+
subcommands:
151+
- name: g++
152+
link: "{{ g_plus_plus_bin_path.stdout }}"
153+
path: "{{ g_plus_plus_expected_version_bin_path.stdout }}"
154+
state: auto
155+
110156
- name: Install kubernetes components for Ubuntu on NVIDIA Cloud Native Stack
111157
become: true
112158
when: "ansible_distribution == 'Ubuntu'"
@@ -1520,4 +1566,4 @@
15201566
retries: 5
15211567
delay: 5
15221568
register: install_helm_arm
1523-
until: install_helm_arm is succeeded
1569+
until: install_helm_arm is succeeded

0 commit comments

Comments
 (0)