Skip to content

Commit 7e5e1cb

Browse files
authored
aix: fix broken playbook and use dnf (#4202)
Fixes: #4187
1 parent de38bc6 commit 7e5e1cb

File tree

6 files changed

+31
-5
lines changed

6 files changed

+31
-5
lines changed

ansible.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ scp_if_ssh = True
2424
become_user = root
2525
become_method = sudo
2626

27+
[hosts:aix]
28+
ansible_python_interpreter = /opt/freeware/libexec/python3
29+
2730
[hosts:smartos]
2831
ansible_python_interpreter = /opt/local/bin/python
2932

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Appears to be some issue with the Ansible dnf task on AIX and gcc10-c++,
2+
# so manage that package here.
3+
4+
- name: Check for gcc10-c++
5+
ansible.builtin.command:
6+
cmd: /opt/freeware/bin/dnf list installed gcc10-c++
7+
changed_when: no
8+
check_mode: no
9+
failed_when: no
10+
register: gcc10_installed
11+
12+
- name: Install gcc10-c++
13+
ansible.builtin.command:
14+
cmd: /opt/freeware/bin/dnf install -y gcc10-c++
15+
when: gcc10_installed.rc != 0

ansible/roles/baselayout/vars/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ common_packages: [
3333
# % ansible -m debug -a "var=os" HOST
3434
packages: {
3535
aix: [
36-
'bash,cmake,coreutils,curl,gcc-c++,tar,unzip,git,make,sudo,python-setuptools,python3.9',
36+
'bash,cmake,coreutils,curl,gcc-c++,tar,unzip,git,make,sudo,python3-setuptools,python3',
3737
],
3838

39+
# Appears to be some issue with the Ansible dnf task on AIX and gcc10-c++, so handle separately.
3940
aix72: [
40-
'gcc8-c++,gcc10-c++,gcc12-c++'
41+
'gcc8-c++,gcc12-c++'
4142
],
4243

44+
# Appears to be some issue with the Ansible dnf task on AIX and gcc10-c++, so handle separately.
4345
aix73: [
44-
'gcc8-c++,gcc10-c++,gcc12-c++'
46+
'gcc8-c++,gcc12-c++'
4547
],
4648

4749
ibmi: [

ansible/roles/bootstrap/tasks/partials/aix.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,8 @@
7373
- name: Set hostname to inventory_hostname AIX
7474
ansible.builtin.command: hostname {{ inventory_hostname }}
7575
when: current_hostname.stdout != inventory_hostname
76+
77+
- name: set pkg_mgr
78+
ansible.builtin.set_fact:
79+
ansible_facts:
80+
pkg_mgr: dnf

ansible/roles/package-upgrade/tasks/partials/dnf.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
ansible.builtin.dnf:
99
name: "*"
1010
state: latest
11+
use_backend: "{{ os|startswith('aix')|ternary('dnf4', omit) }}"
1112
notify: package updated

ansible/roles/package-upgrade/vars/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#
66

77
pm: {
8-
'yum': ['centos', 'rhel7', 'aix72', 'ibmi'],
8+
'yum': ['centos', 'rhel7', 'ibmi'],
99
'apt': ['debian', 'ubuntu'],
10-
'dnf': ['aix73', 'fedora', 'rhel8', 'rhel9'],
10+
'dnf': ['aix72', 'aix73', 'fedora', 'rhel8', 'rhel9'],
1111
'pkgng': 'freebsd',
1212
'pkgin': 'smartos',
1313
'chocolatey': 'win',

0 commit comments

Comments
 (0)