Skip to content

Commit

Permalink
initial ansible support for aix71 (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
George Adams committed Feb 7, 2019
1 parent 24678ec commit 85c9a86
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ansible/roles/baselayout/tasks/main.yml
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("macos") and not os|startswith("aix")
hostname: name="{{ safe_hostname }}"

- name: Set hostname to inventory_hostname macOS
Expand All @@ -28,6 +28,10 @@
- "dscacheutil -flushcache"
when: os|startswith("macos")

- name: Set hostname to inventory_hostname AIX
command: " hostname {{ inventory_hostname }}.nodejs.org"
when: os|startswith("aix")

- name: disable joyent smartconnect
when: os|startswith("smartos")
notify: restart sshd
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/baselayout/vars/main.yml
Expand Up @@ -46,6 +46,10 @@ packages: {
'ccache,gcc-c++,devtoolset-6,sudo',
],

aix: [
'gcc-c++,sudo',
],

debian7: [
'gcc-4.8,g++-4.8,sudo',
],
Expand Down
21 changes: 21 additions & 0 deletions ansible/roles/java-base/tasks/main.yml
Expand Up @@ -65,6 +65,27 @@
when: java.rc > 0 and os|startswith("macos")
package: name="{{ java_package_name }}" state=present

- name: check if java is installed AIX
stat:
path: /home/iojs/jdk8u192-b12-jre/bin
register: java_exists
when: os|startswith("aix")

- 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
dest: /tmp/
tags: java
when: java_exists.stat.exists == False and os|startswith("aix")

- name: unarchive java AIX
unarchive:
src: /tmp/OpenJDK8U-jre_ppc64_aix_hotspot_8u192b12.tar.gz
remote_src: yes
dest: /home/iojs
tags: java
when: java_exists.stat.exists == False and os|startswith("aix")

- name: install webupd8 oracle java 8 extras
when: java.rc > 0 and os in ("ubuntu1204", "ubuntu1404") and arch != "ppc64"
package: name="{{item}}" state=present
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/jenkins-worker/tasks/main.yml
Expand Up @@ -232,7 +232,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")
when: not os|startswith("zos") and not os|startswith("macos") and not os|startswith("aix")
service: name=jenkins state=restarted enabled=yes

- name: Unload org.nodejs.osx.jenkins.plist from launchctl
Expand Down
30 changes: 30 additions & 0 deletions ansible/roles/jenkins-worker/tasks/partials/tap2junit/aix.yml
@@ -0,0 +1,30 @@
---

#
# aix: python2.7 is default
#

- name: check if pip exists
stat:
path: /usr/bin/pip
register: pip_exists

- name: download get-pip.py
get_url:
url: http://bootstrap.pypa.io/get-pip.py
dest: /home/iojs/get-pip.py
when: pip_exists.stat.exists == False

- name: install pip
raw: /usr/bin/python /home/iojs/get-pip.py
when: pip_exists.stat.exists == False

- name: create symbolic link
file:
src: "/opt/freeware/bin/pip"
dest: "/usr/bin/pip"
state: link
when: pip_exists.stat.exists == False

- name: install tap2junit
pip: name=tap2junit state=present
12 changes: 12 additions & 0 deletions ansible/roles/jenkins-worker/templates/aix.rc2.j2
@@ -0,0 +1,12 @@
#!/bin/sh
export HOME={{ home }}/{{ server_user }}
export NODE_TEST_DIR="$HOME/tmp"
export JOBS="{{ jobs_env }}"

export OSTYPE=aix
export ARCH=ppc64le
export DESTCPU=ppc64le

{{ 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
8 changes: 8 additions & 0 deletions ansible/roles/jenkins-worker/vars/main.yml
Expand Up @@ -5,6 +5,7 @@
#

init: {
aix: 'aix71',
centos5: 'centos5',
centos6: 'centos6',
debian: ['debian7', 'ubuntu1204'],
Expand All @@ -18,6 +19,11 @@ init: {
}

jenkins_init: {
aix: {
dest: '/etc/rc.d/rc2.d/Sjenkins',
src: 'aix.rc2.j2',
mode: '0555'
},
centos5: {
dest: '/etc/init.d/jenkins',
src: 'centos5.initd.j2',
Expand Down Expand Up @@ -85,6 +91,7 @@ needs_monit: [

# some os'es needs different paths to java. add them here.
java_path: {
'aix71': '/home/iojs/jdk8u192-b12-jre/bin/java',
'macos10.10': 'java',
'macos10.11': 'java',
'macos10.12': 'java',
Expand All @@ -97,6 +104,7 @@ java_path: {

# same for bash. will default to /bin/bash if you don't set it
bash_path: {
aix: '/usr/bin/ksh',
freebsd: '/usr/local/bin/bash',
zos: 'bash'
}
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/package-upgrade/vars/main.yml
Expand Up @@ -5,7 +5,7 @@
#

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

0 comments on commit 85c9a86

Please sign in to comment.