diff --git a/README.md b/README.md index 55d417d24..3f453960a 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ The following companies are contributing hardware to this project: * [DigitalOcean](http://digitalocean.com/) (via Mikeal Rogers) * [Rackspace](http://rackspace.com/) (via Paul Querna) * [IBM](http://www.ibm.com/) / [Softlayer](http://www.softlayer.com/) (via Dave Ings and Andrew Low) +* [Walmart](http://www.walmartlabs.com/) (via Wyatt Preul) People diff --git a/setup/ansible-inventory b/setup/ansible-inventory index d42220ce3..585e7f243 100644 --- a/setup/ansible-inventory +++ b/setup/ansible-inventory @@ -24,6 +24,9 @@ iojs-build-ubuntu1204-64-1 iojs-build-ubuntu1004-64-1 iojs-build-ubuntu1004-32-1 +[iojs-build-smartos] +iojs-build-smartos ansible_python_interpreter=/opt/local/bin/python ansible_ssh_user=root ansible_ssh_host=165.225.129.118 + [iojs-build-containers] iojs-build-containers-1 iojs-build-containers-2 @@ -47,3 +50,6 @@ iojs-jenkins iojs-build-centos7 iojs-build-centos6 iojs-build-centos5 + +[iojs-smartos:children] +iojs-build-smartos \ No newline at end of file diff --git a/setup/smartos/README.md b/setup/smartos/README.md new file mode 100644 index 000000000..b1adf0780 --- /dev/null +++ b/setup/smartos/README.md @@ -0,0 +1,14 @@ +# io.js Build SmartOS Setup + +Note that these hostnames are also used in the *[ansible-inventory](http://docs.ansible.com/intro_inventory.html)* file. +The IP addresses will need to be updated each time the servers are reprovisioned. + +To set up a host, run: + +```text +$ ansible-playbook -i ../ansible-inventory ansible-playbook.yaml +``` + +**Users**: The ansible-vars.yaml file contains a list of users who's GitHub public keys are pulled and placed into +authorized_keys for both root and iojs users. This file should be updates when new users are added to the build project +who are able to help maintain the containerized builds. diff --git a/setup/smartos/ansible-playbook.yaml b/setup/smartos/ansible-playbook.yaml new file mode 100644 index 000000000..1306e0706 --- /dev/null +++ b/setup/smartos/ansible-playbook.yaml @@ -0,0 +1,70 @@ +--- +- hosts: iojs-build-smartos + + remote_user: root + + tasks: + + - include_vars: ansible-vars.yaml + tags: vars + + - name: General | pkgin Update + command: pkgin up + tags: general + + - name: General | Install required packages + command: pkgin -y in {{ item }} + with_items: packages + tags: general + + - name: User | Add {{ server_user }} group + command: groupadd {{ server_user }} + tags: user + + - name: User | Add {{ server_user }} user + user: name="{{ server_user }}" shell=/bin/bash append=yes groups=staff,{{ server_user }} + tags: user + + - name: User | Unlock {{ server_user }} user + command: passwd -N {{ server_user }} + tags: user + + - name: User | Download pubkey(s) + get_url: url=https://github.com/{{ item }}.keys dest=/tmp/{{ item }}.keys + delegate_to: 127.0.0.1 + with_items: ssh_users + tags: user + + - name: General | Create authorized_keys for root + authorized_key: user="root" key="{{ lookup('file', '/tmp/' + item + '.keys') }}" + with_items: ssh_users + tags: user + + - name: General | Create authorized_keys for {{ server_user }} + authorized_key: user="{{ server_user }}" key="{{ lookup('file', '/tmp/' + item + '.keys') }}" + with_items: ssh_users + tags: user + + - name: Jenkins | Download Jenkins' slave.jar + command: curl -sL https://jenkins-iojs.nodesource.com/jnlpJars/slave.jar -o /home/{{ server_user }}/slave.jar + tags: jenkins + + - name: Jenkins | Copy SMF manifest + copy: src=./resources/jenkins_manifest.xml dest=/home/{{ server_user }}/jenkins_manifest.xml owner={{ server_user }} group={{ server_user }} mode=0755 + tags: jenkins + + - name: Jenkins | Copy secrets into manifest + replace: dest=/home/{{ server_user }}/jenkins_manifest.xml regexp="\{\{secret\}\}" replace="{{ server_secret }}" + tags: jenkins + + - name: Jenkins | Copy server id into manifest + replace: dest=/home/{{ server_user }}/jenkins_manifest.xml regexp="\{\{id\}\}" replace="{{ server_id }}" + tags: jenkins + + - name: Jenkins | Import jenkins SMF manifest + command: svccfg -v import /home/{{ server_user }}/jenkins_manifest.xml + tags: jenkins + + - name: Jenkins | Start service + command: svcadm enable svc:/application/jenkins:default + tags: jenkins diff --git a/setup/smartos/ansible-vars.yaml b/setup/smartos/ansible-vars.yaml new file mode 100644 index 000000000..f24855bef --- /dev/null +++ b/setup/smartos/ansible-vars.yaml @@ -0,0 +1,15 @@ +--- +server_user: iojs +ssh_users: + - geek + - rvagg + - jbergstroem +packages: + - openjdk7-1.7.65 + - git-2.1.0 + - gcc49-4.9.1 + - gcc49-libs-4.9.1nb1 + - gccmakedep-1.0.3 + - gmake-4.0 + - automake-1.14.1nb1 + - libtool-2.4.2nb2 diff --git a/setup/smartos/host_vars/.gitignore b/setup/smartos/host_vars/.gitignore new file mode 100644 index 000000000..268bc1142 --- /dev/null +++ b/setup/smartos/host_vars/.gitignore @@ -0,0 +1 @@ +iojs-build-smartos-* \ No newline at end of file diff --git a/setup/smartos/resources/jenkins_manifest.xml b/setup/smartos/resources/jenkins_manifest.xml new file mode 100644 index 000000000..7c4767f42 --- /dev/null +++ b/setup/smartos/resources/jenkins_manifest.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file