Skip to content

Commit a919fd4

Browse files
George Adamskadler
authored andcommitted
Add new IBM i system
Add ccache dependency Add libstdc++-devel Add new IBM i system Add PASE_PATH to ibmi_start SBMJOB cleanup merge issue garbage Co-Authored-By: Kevin Adler <kadler@us.ibm.com> fix ProdDava spelling FIXUP fixup ansible misspelling fixup CentOS conflict fixup! merge issues Get rid of IBM i manual steps for bootstrap Initial IBMi playbook Misc preparation for IBM i Remove QSECOFR IBM i RPM Repo from bootstrap task Restructure os condition for readability Rewrite ibmi_start.j2 to use SBMJOB instead of su set yum backend Split ibmi packages into separate lines for readability WIP - host vars WIP - one machine should be release?
1 parent 59902dd commit a919fd4

17 files changed

Lines changed: 196 additions & 10 deletions

File tree

ansible/MANUAL_STEPS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,3 +479,15 @@ After these steps are performed and the Pi's are running, Ansible can be run to
479479
[Setting up a Windows Host]: https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html
480480
[newer Ansible configuration]: https://github.com/nodejs/build/tree/master/ansible
481481
[stand-alone]: https://github.com/nodejs/build/tree/master/setup/windows
482+
483+
## IBMi
484+
485+
Ansible 2.7.6 is required.
486+
487+
There isn't a system start service on IBMi -- the machine should not be
488+
rebooted, and after ansible is run, jenkins needs to be started with
489+
jenkins-start.sh, as the iojs user.
490+
491+
XXX how do people become the iojs user? Probably pre-ansible the
492+
`nodejs_build_test` user's keys need installing as the nodejs and iojs user on
493+
the target box.

ansible/ansible.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ ansible_python_interpreter = /usr/bin/python3
3737
[hosts:ibm]
3838
become_method = sudo
3939

40+
[hosts:iinthecloud]
41+
ansible_become = false
42+
ansible_python_interpreter = /QOpenSys/pkgs/bin/python2
43+
4044
[hosts:marist]
4145
ansible_become = false
4246
ansible_python_interpreter = /NODEJS2/python-2017-04-12-py27/python27/bin/python
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
secret: "SECRET"
3+
server_jobs: "4"

ansible/inventory.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ hosts:
3838
aix71-ppc64_be-1: {ip: 129.33.196.199, user: b9s010a}
3939
rhel7-s390x-1: {ip: 148.100.86.101, user: linux1}
4040

41+
- iinthecloud:
42+
ibmi72-ppc64_be-1: {ip: 65.183.160.62, user: nodejs}
43+
4144
- joyent:
4245
smartos15-x64-2: {ip: 165.225.148.139}
4346
smartos17-x64-2: {ip: 165.225.149.208}
@@ -181,6 +184,10 @@ hosts:
181184
macos10.14-x64-1: {ip: 199.7.167.99, port: 8822, user: administrator}
182185
macos10.14-x64-2: {ip: 199.7.167.100, port: 8824, user: administrator}
183186

187+
- iinthecloud:
188+
ibmi72-ppc64_be-1: {ip: 65.183.160.52, user: nodejs}
189+
ibmi72-ppc64_be-2: {ip: 65.183.160.59, user: nodejs}
190+
184191
- rackspace:
185192
centos7-x64-1: {ip: 119.9.27.82}
186193
debian8-x64-1: {ip: 23.253.109.216}

ansible/playbooks/jenkins/worker/create.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
- "!test-ibm-ubuntu1804-x64-1"
8585
tasks:
8686
- name: remove node and npm packages
87-
when: not os|startswith("win") and not os|startswith("zos")
87+
when: not os|startswith("win") and not os|startswith("zos") and not os|startswith("ibmi")
8888
package:
8989
name: "{{ package }}"
9090
state: absent

ansible/plugins/inventory/nodejs_yaml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
'type': ('infra', 'release', 'test'),
4646

4747
# providers - validated for consistency
48-
'provider': ('azure', 'digitalocean', 'ibm', 'joyent', 'linuxonecc',
48+
'provider': ('azure', 'digitalocean', 'ibm', 'iinthecloud', 'joyent', 'linuxonecc',
4949
'macstadium', 'marist', 'mininodes', 'msft', 'osuosl',
5050
'orka', 'rackspace', 'requireio', 'scaleway', 'softlayer', 'voxer',
5151
'packetnet', 'nearform')

ansible/roles/baselayout/tasks/main.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
- name: set hostname
1919
when: not os|startswith("smartos") and not os|startswith("zos")
20-
and not os|startswith("macos") and not os|startswith("aix")
20+
and not os|startswith("macos") and not os|startswith("aix") and not os|startswith("ibmi")
2121
hostname: name="{{ safe_hostname }}"
2222

2323
- name: Set hostname to inventory_hostname macOS
@@ -73,7 +73,7 @@
7373
state: absent
7474

7575
- name: install packages
76-
when: not os|startswith("zos") and not os|startswith("macos")
76+
when: not os|startswith("zos") and not os|startswith("macos") and not os|startswith("ibmi")
7777
package: name="{{ package }}" state=present
7878
loop_control:
7979
loop_var: package
@@ -84,6 +84,28 @@
8484
- "{{ packages[os|stripversion]|default('[]') }}"
8585
- "{{ common_packages|default('[]') }}"
8686

87+
- name: install packages IBMi
88+
when: os|startswith("ibmi")
89+
yum: name="{{ package }}" state=present use_backend=yum
90+
loop_control:
91+
loop_var: package
92+
with_items:
93+
# ansible doesn't like empty lists
94+
- "{{ packages[os]|default('[]') }}"
95+
- "{{ packages[os|stripversion]|default('[]') }}"
96+
- "{{ common_packages|default('[]') }}"
97+
98+
- name: install packages IBMi
99+
when: os|startswith("ibmi")
100+
yum: name="{{ package }}" state=present use_backend=yum
101+
loop_control:
102+
loop_var: package
103+
with_items:
104+
# ansible doesn't like empty lists
105+
- "{{ packages[os]|default('[]') }}"
106+
- "{{ packages[os|stripversion]|default('[]') }}"
107+
- "{{ common_packages|default('[]') }}"
108+
87109
- name: install packages (macos)
88110
when: os|startswith("macos")
89111
become_user: administrator

ansible/roles/baselayout/vars/main.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ packages: {
5757
'bash,cmake,gcc-c++,gcc6-c++,tar,unzip,git,make,sudo',
5858
],
5959

60+
# @jgorzins - this works, but @rvagg says doing it as a concatenated string
61+
# as above is _significantly_ faster to execute
62+
ibmi: [
63+
'autoconf',
64+
'automake',
65+
'ca-certificates-mozilla',
66+
'ccache',
67+
'coreutils-gnu',
68+
'gcc',
69+
'gcc-cplusplus',
70+
'gcc-cpp',
71+
'git',
72+
'libstdcplusplus-devel',
73+
'openssl-devel >= 1.1.1',
74+
'python2-pip',
75+
'sed-gnu',
76+
'zlib-devel',
77+
],
78+
6079
debian7: [
6180
'gcc-4.8,g++-4.8,sudo',
6281
],

ansible/roles/java-base/tasks/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@
115115
register: java_exists
116116
when: os|startswith("aix")
117117

118+
- name: check if java is installed IBMi
119+
stat:
120+
path: /QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit/bin/java
121+
register: java_exists
122+
when: os|startswith("ibmi")
123+
118124
- name: download java AIX
119125
get_url:
120126
url: https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u192-b12/OpenJDK8U-jre_ppc64_aix_hotspot_8u192b12.tar.gz

ansible/roles/jenkins-worker/tasks/main.yml

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,23 @@
2525
when: jobs_env is undefined
2626

2727
- name: create group
28-
when: not os|startswith("zos")
28+
when: not os|startswith("zos") and not os|startswith("ibmi")
2929
group: name="{{ server_user }}"
3030

3131
- name: create user
32-
when: "not os|startswith('zos')"
32+
when: "not os|startswith('zos') and not os|startswith('ibmi')"
3333
user:
3434
name: "{{ server_user }}"
3535
group: "{{ server_user }}"
3636
shell: "{{ bash_path[os|stripversion]|default('/bin/bash') }}"
3737

38+
- name: create user for ibmi
39+
when: os|startswith("ibmi")
40+
command: "/QOpenSys/usr/bin/system 'CRTUSRPRF USRPRF({{ server_user }}) PASSWORD(*none)'"
41+
ignore_errors: true
42+
3843
- name: add ::1 to /etc/hosts for ipv6 compat
39-
when: not os|startswith("zos")
44+
when: not os|startswith("zos") and not os|startswith("ibmi")
4045
lineinfile:
4146
dest: /etc/hosts
4247
state: present
@@ -46,12 +51,21 @@
4651
file: path="{{ home }}/{{ server_user }}/tmp" state=directory
4752

4853
- name: set NODE_TEST_DIR permission and owner
54+
when: not os|startswith("ibmi")
4955
file:
5056
path: "{{ home }}/{{ server_user }}/tmp"
5157
owner: "{{ server_user }}"
5258
group: "{{ server_user }}"
5359
mode: 0755
5460

61+
# group has very different meaning on IBMi, only set to the build user
62+
- name: set NODE_TEST_DIR permission and owner IBMi
63+
when: os|startswith("ibmi")
64+
file:
65+
path: "{{ home }}/{{ server_user }}/tmp"
66+
owner: "{{ server_user }}"
67+
mode: 0755
68+
5569
- name: run raspberry pi jenkins-worker setup
5670
when: "inventory_hostname|regex_search('-arm(v6l|v7l|64)_pi')"
5771
include: "{{ role_path }}/tasks/partials/raspberry-pi.yml"
@@ -133,6 +147,59 @@
133147
command: systemctl restart iptables
134148
when: "'rhel7-s390x' in inventory_hostname"
135149

150+
- name: Check if SU is installed on IBMi
151+
when: os|startswith("ibmi")
152+
stat:
153+
path: /QOpenSys/pkgs/bin/su
154+
register: su_exists
155+
156+
- name: git clone su on ibmi
157+
git:
158+
repo: https://github.com/ThePrez/IBMiOSS-utils.git
159+
dest: /tmp/IBMiOSS-utils
160+
when: su_exists.stat.exists == False and os|startswith("ibmi")
161+
162+
- name: copy su into /QOpenSys/pkgs/bin IBMi
163+
copy:
164+
src: /tmp/IBMiOSS-utils/su
165+
dest: /QOpenSys/pkgs/bin/su
166+
remote_src: true
167+
when: su_exists.stat.exists == False and os|startswith("ibmi")
168+
169+
- name: copy su-setup into /QOpenSys/pkgs/bin IBMi
170+
copy:
171+
src: /tmp/IBMiOSS-utils/su-setup
172+
dest: /QOpenSys/pkgs/bin/su-setup
173+
remote_src: true
174+
when: su_exists.stat.exists == False and os|startswith("ibmi")
175+
176+
- name: Check if SU is installed on IBMi
177+
when: os|startswith("ibmi")
178+
stat:
179+
path: /QOpenSys/pkgs/bin/su
180+
register: su_exists
181+
182+
# FIXME rewrite jenkins start to use ssh or SBMJOB, so su is not needed.
183+
- name: git clone su on ibmi
184+
git:
185+
repo: https://github.com/ThePrez/IBMiOSS-utils.git
186+
dest: /tmp/IBMiOSS-utils
187+
when: su_exists.stat.exists == False and os|startswith("ibmi")
188+
189+
- name: copy su into /QOpenSys/pkgs/bin IBMi
190+
copy:
191+
src: /tmp/IBMiOSS-utils/su
192+
dest: /QOpenSys/pkgs/bin/su
193+
remote_src: true
194+
when: su_exists.stat.exists == False and os|startswith("ibmi")
195+
196+
- name: copy su-setup into /QOpenSys/pkgs/bin IBMi
197+
copy:
198+
src: /tmp/IBMiOSS-utils/su-setup
199+
dest: /QOpenSys/pkgs/bin/su-setup
200+
remote_src: true
201+
when: su_exists.stat.exists == False and os|startswith("ibmi")
202+
136203
- name: download slave.jar
137204
when: not os|startswith("zos")
138205
get_url:
@@ -313,7 +380,11 @@
313380
name: java-base
314381

315382
- name: enable jenkins at startup - general
316-
when: not os|startswith("zos") and not os|startswith("macos") and not os|startswith("aix")
383+
when:
384+
- not os|startswith("aix")
385+
- not os|startswith("ibmi")
386+
- not os|startswith("macos")
387+
- not os|startswith("zos")
317388
service: name=jenkins state=restarted enabled=yes
318389

319390
- name: Unload org.nodejs.osx.jenkins.plist from launchctl

0 commit comments

Comments
 (0)