Skip to content

Commit bbd4ca7

Browse files
George Adamssam-github
authored andcommitted
Initial IBMi playbook
Add new IBM i system Misc preparation for IBM i Add ccache dependency Split ibmi packages into separate lines for readability Restructure os condition for readability Remove QSECOFR IBM i RPM Repo from bootstrap task Get rid of IBM i manual steps for bootstrap Add libstdc++-devel set yum backend
1 parent e451717 commit bbd4ca7

File tree

17 files changed

+159
-10
lines changed

17 files changed

+159
-10
lines changed

ansible/MANUAL_STEPS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,15 @@ to
1616
```bash
1717
sudo systemsetup -setremotelogin on
1818
```
19+
20+
## IBMi
21+
22+
Ansible 2.7.6 is required.
23+
24+
There isn't a system start service on IBMi -- the machine should not be
25+
rebooted, and after ansibile is run, jenkins needs to be started with
26+
jenkins-start.sh, as the iojs user.
27+
28+
XXX how do people become the iojs user? Probably pre-ansible the
29+
`nodejs_build_test` user's keys need installing as the nodejs and iojs user on
30+
the target box.

ansible/ansible.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ ansible_python_interpreter = /usr/local/bin/python
3333
[hosts:fedora30]
3434
ansible_python_interpreter = /usr/bin/python3
3535

36+
[hosts:iinthecloud]
37+
ansible_become = false
38+
ansible_python_interpreter = /QOpenSys/pkgs/bin/python2
39+
3640
[hosts:marist]
3741
ansible_become = false
3842
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ hosts:
145145
centos7-ppc64_le-1: {ip: 140.211.168.193, user: centos}
146146
centos7-ppc64_le-2: {ip: 140.211.168.244, user: centos}
147147

148+
- iinthecloud:
149+
ibmi72-ppc64_be-1: {ip: 65.183.160.52, user: nodejs}
150+
ibmi72-ppc64_be-2: {ip: 65.183.160.59, user: nodejs}
151+
ibmi72-ppc64_be-3: {ip: 65.183.160.62, user: nodejs}
152+
148153
- rackspace:
149154
centos7-x64-1: {ip: 119.9.27.82}
150155
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
@@ -67,7 +67,7 @@
6767
- "!test-softlayer-ubuntu1604-x64-1"
6868
tasks:
6969
- name: remove node and npm packages
70-
when: not os|startswith("win") and not os|startswith("zos")
70+
when: not os|startswith("win") and not os|startswith("zos") and not os|startswith("ibmi") and os != "centos5"
7171
package:
7272
name: "{{ package }}"
7373
state: absent

ansible/plugins/inventory/nodejs_yaml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
'provider': ('azure', 'digitalocean', 'joyent', 'ibm', 'linuxonecc',
4949
'macstadium', 'marist', 'mininodes', 'msft', 'osuosl',
5050
'rackspace', 'requireio', 'scaleway', 'softlayer', 'voxer',
51-
'packetnet', 'nearform')
51+
'packetnet', 'nearform', 'iinthecloud')
5252
}
5353
DECRYPT_TOOL = "gpg"
5454
INVENTORY_FILENAME = "inventory.yml"

ansible/roles/baselayout/tasks/main.yml

Lines changed: 13 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
@@ -72,7 +72,7 @@
7272
state: absent
7373

7474
- name: install packages
75-
when: not os|startswith("zos") and not os|startswith("macos")
75+
when: not os|startswith("zos") and not os|startswith("macos") and not os|startswith("ibmi")
7676
package: name="{{ package }}" state=present
7777
loop_control:
7878
loop_var: package
@@ -82,6 +82,17 @@
8282
- "{{ packages[os|stripversion]|default('[]') }}"
8383
- "{{ common_packages|default('[]') }}"
8484

85+
- name: install packages IBMi
86+
when: os|startswith("ibmi")
87+
yum: name="{{ package }}" state=present use_backend=yum
88+
loop_control:
89+
loop_var: package
90+
with_items:
91+
# ansible doesn't like empty lists
92+
- "{{ packages[os]|default('[]') }}"
93+
- "{{ packages[os|stripversion]|default('[]') }}"
94+
- "{{ common_packages|default('[]') }}"
95+
8596
- name: install packages (macos)
8697
when: os|startswith("macos")
8798
become_user: administrator

ansible/roles/baselayout/vars/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ packages: {
5050
'gcc-c++,sudo',
5151
],
5252

53+
ibmi: [
54+
'gcc',
55+
'gcc-cplusplus',
56+
'gcc-cpp',
57+
'ccache',
58+
'sed-gnu',
59+
'coreutils-gnu',
60+
'zlib-devel',
61+
'python2-pip',
62+
'git',
63+
'ca-certificates-mozilla',
64+
'libstdcplusplus-devel',
65+
],
66+
5367
debian7: [
5468
'gcc-4.8,g++-4.8,sudo',
5569
],

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@
8686
register: java_exists
8787
when: os|startswith("aix")
8888

89+
- name: check if java is installed IBMi
90+
stat:
91+
path: /QOpenSys/QIBM/ProdDava/JavaVM/jdk80/64bit/bin/java
92+
register: java_exists
93+
when: os|startswith("ibmi")
94+
8995
- name: download java AIX
9096
get_url:
9197
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: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
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: User | create file system on larger disk
@@ -43,12 +43,17 @@
4343
when: "'rhel72-s390x' in inventory_hostname"
4444

4545
- name: create user
46-
when: "not os|startswith('zos') and not 'rhel72-s390x' in inventory_hostname"
46+
when: "not os|startswith('zos') and not os|startswith('ibmi') and not 'rhel72-s390x' in inventory_hostname"
4747
user:
4848
name: "{{ server_user }}"
4949
group: "{{ server_user }}"
5050
shell: "{{ bash_path[os|stripversion]|default('/bin/bash') }}"
5151

52+
- name: create user for ibmi
53+
when: os|startswith("ibmi")
54+
command: "/QOpenSys/usr/bin/system 'CRTUSRPRF USRPRF({{ server_user }}) PASSWORD(*none)'"
55+
ignore_errors: true
56+
5257
- name: create user for rhel72-s390x
5358
user:
5459
name: "{{ server_user }}"
@@ -86,7 +91,7 @@
8691
when: "'rhel72-s390x' in inventory_hostname"
8792

8893
- name: add ::1 to /etc/hosts for ipv6 compat
89-
when: not os|startswith("zos")
94+
when: not os|startswith("zos") and not os|startswith("ibmi")
9095
lineinfile:
9196
dest: /etc/hosts
9297
state: present
@@ -96,12 +101,21 @@
96101
file: path="{{ home }}/{{ server_user }}/tmp" state=directory
97102

98103
- name: set NODE_TEST_DIR permission and owner
104+
when: not os|startswith("ibmi")
99105
file:
100106
path: "{{ home }}/{{ server_user }}/tmp"
101107
owner: "{{ server_user }}"
102108
group: "{{ server_user }}"
103109
mode: 0755
104110

111+
# group has very different meaning on IBMi, only set to the build user
112+
- name: set NODE_TEST_DIR permission and owner IBMi
113+
when: os|startswith("ibmi")
114+
file:
115+
path: "{{ home }}/{{ server_user }}/tmp"
116+
owner: "{{ server_user }}"
117+
mode: 0755
118+
105119
- name: run raspberry pi jenkins-worker setup
106120
when: "inventory_hostname|regex_search('-arm(v6l|v7l|64)_pi')"
107121
include: "{{ role_path }}/tasks/partials/raspberry-pi.yml"
@@ -148,6 +162,45 @@
148162
command: systemctl restart iptables
149163
when: "'rhel72-s390x' in inventory_hostname"
150164

165+
- name: firewalld | allow ipv4 multicast traffic
166+
command: firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -m pkttype --pkt-type multicast -j ACCEPT
167+
when: "'fedora27-x64' in inventory_hostname"
168+
169+
- name: firewalld | allow ipv6 multicast traffic
170+
command: firewall-cmd --permanent --direct --add-rule ipv6 filter INPUT 0 -m pkttype --pkt-type multicast -j ACCEPT
171+
when: "'fedora27-x64' in inventory_hostname"
172+
173+
- name: firewalld | restart so rules take effect
174+
command: systemctl restart firewalld
175+
when: "'fedora27-x64' in inventory_hostname"
176+
177+
- name: Check if SU is installed on IBMi
178+
when: os|startswith("ibmi")
179+
stat:
180+
path: /QOpenSys/pkgs/bin/su
181+
register: su_exists
182+
183+
# FIXME rewrite jenkins start to use ssh, so su is not needed.
184+
- name: git clone su on ibmi
185+
git:
186+
repo: https://github.com/ThePrez/IBMiOSS-utils.git
187+
dest: /tmp/IBMiOSS-utils
188+
when: su_exists.stat.exists == False and os|startswith("ibmi")
189+
190+
- name: copy su into /QOpenSys/pkgs/bin IBMi
191+
copy:
192+
src: /tmp/IBMiOSS-utils/su
193+
dest: /QOpenSys/pkgs/bin/su
194+
remote_src: true
195+
when: su_exists.stat.exists == False and os|startswith("ibmi")
196+
197+
- name: copy su-setup into /QOpenSys/pkgs/bin IBMi
198+
copy:
199+
src: /tmp/IBMiOSS-utils/su-setup
200+
dest: /QOpenSys/pkgs/bin/su-setup
201+
remote_src: true
202+
when: su_exists.stat.exists == False and os|startswith("ibmi")
203+
151204
- name: download slave.jar
152205
when: not os|startswith("zos")
153206
get_url:
@@ -277,7 +330,11 @@
277330
name: java-base
278331

279332
- name: enable jenkins at startup - general
280-
when: not os|startswith("zos") and not os|startswith("macos") and not os|startswith("aix")
333+
when:
334+
- not os|startswith("aix")
335+
- not os|startswith("ibmi")
336+
- not os|startswith("macos")
337+
- not os|startswith("zos")
281338
service: name=jenkins state=restarted enabled=yes
282339

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

0 commit comments

Comments
 (0)