Skip to content
Closed
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
4 changes: 4 additions & 0 deletions ansible/MANUAL_STEPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ to
```bash
sudo systemsetup -setremotelogin on
```

## IBMi
1. Install yum
https://bitbucket.org/ibmi/opensource/src/master/docs/yum/#markdown-header-installation
4 changes: 4 additions & 0 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ ansible_python_interpreter = /opt/local/bin/python
[hosts:freebsd]
ansible_python_interpreter = /usr/local/bin/python

[hosts:iinthecloud]
ansible_become = false
ansible_python_interpreter = /QOpenSys/pkgs/bin/python2

[hosts:marist]
ansible_become = false
ansible_python_interpreter = /NODEJS2/python-2017-04-12-py27/python27/bin/python
Expand Down
4 changes: 4 additions & 0 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ hosts:
ubuntu1404-ppc64_le-2: {ip: 140.211.168.94}
ubuntu1404-ppc64_le-3: {ip: 140.211.168.221, user: root}

- iinthecloud:
ibmi72-ppc64_be-1: {ip: 65.183.160.52, user: nodejs}
ibmi72-ppc64_be-2: {ip: 65.183.160.59, user: nodejs}

- rackspace:
centos7-x64-1: {ip: 119.9.27.82}
debian8-x64-1: {ip: 23.253.109.216}
Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/jenkins/worker/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
- "!test-rackspace-freebsd10-x64-1"
tasks:
- name: remove node and npm packages
when: not os|startswith("win") and not os|startswith("zos") and os != "centos5"
when: not os|startswith("win") and not os|startswith("zos") and not os|startswith("ibmi") and os != "centos5"
package:
name: "{{ package }}"
state: absent
Expand Down
2 changes: 1 addition & 1 deletion ansible/plugins/inventory/nodejs_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
'provider': ('azure', 'digitalocean', 'joyent', 'ibm', 'linuxonecc',
'macstadium', 'marist', 'mininodes', 'msft', 'osuosl',
'rackspace', 'requireio', 'scaleway', 'softlayer', 'voxer',
'packetnet', 'nearform')
'packetnet', 'nearform', 'iinthecloud')
}
DECRYPT_TOOL = "gpg"
INVENTORY_FILENAME = "inventory.yml"
Expand Down
15 changes: 13 additions & 2 deletions ansible/roles/baselayout/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

- name: set hostname
when: not os|startswith("smartos") and not os|startswith("zos")
and not os|startswith("macos") and not os|startswith("aix")
and not os|startswith("macos") and not os|startswith("aix") and not os|startswith("ibmi")
hostname: name="{{ safe_hostname }}"

- name: Set hostname to inventory_hostname macOS
Expand Down Expand Up @@ -72,7 +72,7 @@
state: absent

- name: install packages
when: not os|startswith("zos") and not os|startswith("macos")
when: not os|startswith("zos") and not os|startswith("macos") and not os|startswith("ibmi")
package: name="{{ package }}" state=present
loop_control:
loop_var: package
Expand All @@ -82,6 +82,17 @@
- "{{ packages[os|stripversion]|default('[]') }}"
- "{{ common_packages|default('[]') }}"

- name: install packages IBMi
when: os|startswith("ibmi")
yum: name="{{ package }}" state=present
loop_control:
loop_var: package
with_items:
# ansible doesn't like empty lists
- "{{ packages[os]|default('[]') }}"
- "{{ packages[os|stripversion]|default('[]') }}"
- "{{ common_packages|default('[]') }}"

- name: install packages (macos)
when: os|startswith("macos")
become_user: administrator
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/baselayout/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ packages: {
'gcc-c++,sudo',
],

ibmi: [
'gcc-aix', 'gcc-cplusplus-aix', 'gcc-cpp', 'sed-gnu', 'coreutils-gnu', 'zlib-devel', 'openssl-devel >= 1.1.1', 'python2-pip', 'git', 'ca-certificates',
],

debian7: [
'gcc-4.8,g++-4.8,sudo',
],
Expand Down
12 changes: 12 additions & 0 deletions ansible/roles/bootstrap/tasks/partials/ibmi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

#
# IBMi initial tools
#

- name: Add repository
yum_repository:
name: qsecofr
description: QSECOFR IBM i RPM Repo
baseurl: http://repo.qseco.fr
reposdir: /QOpenSys/etc/yum/repos.d
6 changes: 6 additions & 0 deletions ansible/roles/java-base/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
register: java_exists
when: os|startswith("aix")

- name: check if java is installed IBMi
stat:
path: /QOpenSys/QIBM/ProdDava/JavaVM/jdk80/64bit/bin/java
register: java_exists
when: os|startswith("ibmi")

- name: download java AIX
get_url:
url: https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u192-b12/OpenJDK8U-jre_ppc64_aix_hotspot_8u192b12.tar.gz
Expand Down
47 changes: 43 additions & 4 deletions ansible/roles/jenkins-worker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
when: jobs_env is undefined

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

- name: User | create file system on larger disk
Expand All @@ -43,12 +43,17 @@
when: "'rhel72-s390x' in inventory_hostname"

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

- name: create user for ibmi
when: os|startswith("ibmi")
command: "/QOpenSys/usr/bin/system 'CRTUSRPRF USRPRF({{ server_user }}) PASSWORD(*none)'"
ignore_errors: true

- name: create user for rhel72-s390x
user:
name: "{{ server_user }}"
Expand All @@ -65,7 +70,7 @@
when: "'rhel72-s390x' in inventory_hostname"

- name: add ::1 to /etc/hosts for ipv6 compat
when: not os|startswith("zos")
when: not os|startswith("zos") and not os|startswith("ibmi")
lineinfile:
dest: /etc/hosts
state: present
Expand All @@ -75,12 +80,20 @@
file: path="{{ home }}/{{ server_user }}/tmp" state=directory

- name: set NODE_TEST_DIR permission and owner
when: not os|startswith("ibmi")
file:
path: "{{ home }}/{{ server_user }}/tmp"
owner: "{{ server_user }}"
group: "{{ server_user }}"
mode: 0755

- name: set NODE_TEST_DIR permission and owner IBMi
when: os|startswith("ibmi")
file:
path: "{{ home }}/{{ server_user }}/tmp"
owner: "{{ server_user }}"
mode: 0755

- name: run raspberry pi jenkins-worker setup
when: "inventory_hostname|regex_search('-arm(v6l|v7l|64)_pi')"
include: "{{ role_path }}/tasks/partials/raspberry-pi.yml"
Expand Down Expand Up @@ -120,6 +133,32 @@
command: systemctl restart iptables
when: "'rhel72-s390x' in inventory_hostname"

- name: Check if SU is installed on IBMi
when: os|startswith("ibmi")
stat:
path: /QOpenSys/pkgs/bin/su
register: su_exists

- name: git clone su on ibmi
git:
repo: https://github.com/ThePrez/IBMiOSS-utils.git
dest: /tmp/IBMiOSS-utils
when: su_exists.stat.exists == False and os|startswith("ibmi")

- name: copy su into /QOpenSys/pkgs/bin IBMi
copy:
src: /tmp/IBMiOSS-utils/su
dest: /QOpenSys/pkgs/bin/su
remote_src: true
when: su_exists.stat.exists == False and os|startswith("ibmi")

- name: copy su-setup into /QOpenSys/pkgs/bin IBMi
copy:
src: /tmp/IBMiOSS-utils/su-setup
dest: /QOpenSys/pkgs/bin/su-setup
remote_src: true
when: su_exists.stat.exists == False and os|startswith("ibmi")

- name: download slave.jar
when: not os|startswith("zos")
get_url:
Expand Down Expand Up @@ -232,7 +271,7 @@
command: "chown -R {{ server_user }} {{ home }}/{{ server_user }}/gyp"

- name: enable jenkins at startup - general
when: not os|startswith("zos") and not os|startswith("macos") and not os|startswith("aix")
when: not os|startswith("zos") and not os|startswith("macos") and not os|startswith("aix") and not os|startswith("ibmi")
service: name=jenkins state=restarted enabled=yes

- name: Unload org.nodejs.osx.jenkins.plist from launchctl
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

#
# install tap2junit ibmi
#

- name: install tap2junit
pip: name=tap2junit state=present
executable: pip2
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
#

- name: install tap2junit
pip: name=tap2junit state=present
pip: name=tap2junit state=present
15 changes: 15 additions & 0 deletions ansible/roles/jenkins-worker/templates/ibmi_start.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

su -s - iojs <<'EOF'

export PATH=/QOpenSys/pkgs/bin:/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin
export HOME={{ home }}/{{ server_user }}
export NODE_COMMON_PIPE="$HOME/test.pipe"
export NODE_TEST_DIR="$HOME/tmp"
export JOBS=4
export OSTYPE=ibmi

{{ java_path[os] }} -Xmx{{ server_ram|default('128m') }} \
-jar {{ home }}/{{ server_user }}/slave.jar -secret {{ secret }} \
-jnlpUrl {{ jenkins_url }}/computer/{{ inventory_hostname }}/slave-agent.jnlp >{{ home }}/{{ server_user }}/jenkins.log 2>&1 &
EOF
6 changes: 6 additions & 0 deletions ansible/roles/jenkins-worker/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

init: {
aix: 'aix71',
ibmi: 'ibmi72',
centos5: 'centos5',
centos6: 'centos6',
debian: ['debian7', 'ubuntu1204'],
Expand Down Expand Up @@ -75,6 +76,10 @@ jenkins_init: {
dest: '{{ home }}/{{ server_user }}/start.sh',
src: 'zos_start.j2'
},
ibmi: {
dest: '{{ home }}/{{ server_user }}/start.sh',
src: 'ibmi_start.j2'
},
}

# if you fail here, it means it cant map your os or os family to a init system
Expand All @@ -92,6 +97,7 @@ needs_monit: [
# some os'es needs different paths to java. add them here.
java_path: {
'aix71': '/home/iojs/jdk8u192-b12-jre/bin/java',
'ibmi72': '/QOpenSys/QIBM/ProdDava/JavaVM/jdk80/64bit/bin/java',
'macos10.10': 'java',
'macos10.11': 'java',
'macos10.12': 'java',
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/package-upgrade/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

pm: {
'yum': ['centos', 'rhel72', 'aix'],
'yum': ['centos', 'rhel72', 'aix', 'ibmi'],
'apt': ['debian', 'ubuntu'],
'dnf': 'fedora',
'pkg': 'freebsd',
Expand Down