These are the ansible playbooks we use to configure our Mac machines for usage with Jenkins CI. They are used as nodes and need to install the following tools:
- Homebrew
- Ruby
- ios-sim (for use with ISRakel)
- Java (because JNLP needs Java to connect to our master Jenkins)
So as you can guess we have one master (Linux) which the Mac OS X nodes connect to via JNLP.
Setup of the master is not covered by this repository.
In addition to installing tools it also does the following:
- Installs Xcode using Xcode::Install
- Configures monit which monitors the JNLP process and restarts it if goes down.
To install ansible simply run:
$ brew install ansible
You can cluster nodes, e.g. [macpros]
. Each node gets a name, we usually use macpro<ip_address>
and an ansible_ssh_host
which is the actual IP address of this node.
# inventory
[macpros]
macpro1 ansible_ssh_host=191.168.178.23
macpro2 ansible_ssh_host=191.168.178.24
Please note that each host has its own configuration in its own folder.
# host_vars/macpro1/main.yml
---
jnlp_url: http://ci.example.com/computer/macpro1/slave-agent.jnlp
jnlp_secret: kfldsfjkhf12hroi32urz4h3o4öti43zthi # Actual JNLP secret
xcode_version: "6.3"
# osx.yml
hosts: macpros # This is the name your gave your cluster in the inventory file
...
vars:
- home_dir: /Users/jenkins
- jenkins_home_dir: /Users/jenkins/Jenkins
- jenkins_url: http://ci.example.com
...
# roles/monit/vars/main.yml
monit_path: /Users/jenkins/Jenkins/monit
# roles/xcode/vars/main.yml
...
deliver_user: ... # Your Apple Dev center user
deliver_password: ... # Your Apple Dev center password
This will ssh into each node and execute all the steps defined in osx.yml
$ ansbile-playbook osx.yml --ask-sudo-pass
XING AG
Released under the MIT license. See the LICENSE file for more info.