Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Config file.
config.yml
!tests/config.yml

# Hosts file.
hosts
Expand Down
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
services: docker

env:
# Test on ubuntu and mint OSes.
- distro: ubuntu1604
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
docker_image: "geerlingguy/docker-ubuntu1604-ansible:latest"
- distro: ubuntu1404
init: /sbin/init
run_opts: ""
docker_image: "geerlingguy/docker-ubuntu1404-ansible:latest"

before_install:
# Pull container.
- 'docker pull ${docker_image}'

script:
- container_id=$(mktemp)
- cp tests/config.yml config.yml
# Run container in detached state.
- 'docker run --detach --volume="${PWD}":/root/developer_machine:rw ${run_opts} ${docker_image} "${init}" > "${container_id}"'

# Install dependencies.
- 'docker exec "$(cat ${container_id})" ansible-galaxy install -r /root/developer_machine/provisioning/requirements.yml'

# Ansible syntax check.
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /root/developer_machine/provisioning/playbook.yml --syntax-check'

# Test role.
- 'docker exec "$(cat ${container_id})" env TERM=xterm ansible-playbook /root/developer_machine/provisioning/playbook.yml'

# Test role idempotence.
- idempotence=$(mktemp)
- docker exec "$(cat ${container_id})" ansible-playbook /root/developer_machine/provisioning/playbook.yml | tee -a {idempotence}
- >
tail ${idempotence}
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
21 changes: 11 additions & 10 deletions custom.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ install_spotify: true
install_node: true
install_ruby: true
install_virtualbox: true
install_ansible: true
manativm: false

# PHP configuration.
php_packages:
- php5-common
- php5-cli
- php5-dev
- php7.1-common
- php7.1-cli
- php7.1-dev
- libpcre3-dev
- php5-gd
- php5-curl
- php5-imap
- php5-json
- php5-opcache
- php5-xml
- php5-mbstring
- php7.1-gd
- php7.1-curl
- php7.1-imap
- php7.1-json
- php7.1-opcache
- php7.1-xml
- php7.1-mbstring
- php-sqlite3
- php-apcu
4 changes: 3 additions & 1 deletion provisioning/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
gather_facts: False
pre_tasks:
- include: tasks/init.yml
- include: tasks/include-vars.yml
- include: tasks/init-debian.yml
- include: tasks/ansible.yml
when: install_ansible

roles:
# Essential roles.
- geerlingguy.git
- dwcramer.ansible
- andrewrothstein.vagrant
- { role: wtanaka.virtualbox, when: install_virtualbox }
- { role: gvillalta99.nvm, when: install_node }
Expand Down
17 changes: 17 additions & 0 deletions provisioning/tasks/ansible.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# tasks file for ansible (Ubuntu specific)

- name: Install Ansible PPA key
apt_key: >
id=6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367
keyserver=keyserver.ubuntu.com
state=present

- name: Install Ansible PPA
apt_repository: >
repo='ppa:ansible/ansible'
state=present
codename={{ distro_codename }}

- name: Install Ansible packages
apt: name='ansible' state=present update_cache=yes
9 changes: 9 additions & 0 deletions provisioning/tasks/include-vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Include codename var.
include_vars: "{{ ansible_distribution_release }}.yml"
when: (ansible_distribution == "Ubuntu" and ansible_distribution_release == "qiana") or
(ansible_distribution == "Ubuntu" and ansible_distribution_release == "rebecca") or
(ansible_distribution == "Ubuntu" and ansible_distribution_release == "rafaela") or
(ansible_distribution == "Ubuntu" and ansible_distribution_release == "rosa") or
(ansible_distribution == "Ubuntu" and ansible_distribution_release == "sarah") or
(ansible_distribution == "Ubuntu" and ansible_distribution_release == "serena")
5 changes: 4 additions & 1 deletion provisioning/tasks/init-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@
- libgnome-keyring-dev

- name: Add repository for PHP
apt_repository: repo='ppa:ondrej/php'
apt_repository:
repo='ppa:ondrej/php'
state=present
codename={{ distro_codename }}
17 changes: 8 additions & 9 deletions provisioning/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@
ansible_python_interpreter: /usr/bin/python2.7
drush_version: '8.x'
ansible_install_version: '2.2.1'
vagrant_version: '1.9.1'
vagrant_version: '2.0.1'
vagrant_pkg_suffix: 'deb'
nvm:
default_node_version: "4"
default_node_version: "6"
node_version: "6"
dependencies:
apt:
- git
- curl
- build-essential
- libssl-dev
node_versions:
- '4'
- '5'
- '6'
packages:
- grunt-cli
- gulp-cli
- bower
packages: []
path: "~/.nvm"
profile_file: "~/.bashrc"
version: 'v0.20.0'
version: 'v0.33.8'
rvm_install_type: 'user'
extra_packages:
- mysql-client
- nfs-kernel-server

distro_codename: "{{ ansible_distribution_release }}"
1 change: 1 addition & 0 deletions provisioning/vars/qiana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distro_codename: 'trusty'
1 change: 1 addition & 0 deletions provisioning/vars/rafaela.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distro_codename: 'trusty'
1 change: 1 addition & 0 deletions provisioning/vars/rebecca.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distro_codename: 'trusty'
1 change: 1 addition & 0 deletions provisioning/vars/rosa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distro_codename: 'trusty'
1 change: 1 addition & 0 deletions provisioning/vars/sarah.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distro_codename: 'xenial'
1 change: 1 addition & 0 deletions provisioning/vars/serena.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distro_codename: 'xenial'
27 changes: 27 additions & 0 deletions tests/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
install_atom: true
install_keepassx: true
install_chrome: true
install_slack: true
install_dropbox: true
install_spotify: true
install_node: true
install_ruby: true
install_virtualbox: true
install_ansible: false
manativm: false

# PHP configuration.
php_packages:
- php7.1-common
- php7.1-cli
- php7.1-dev
- libpcre3-dev
- php7.1-gd
- php7.1-curl
- php7.1-imap
- php7.1-json
- php7.1-opcache
- php7.1-xml
- php7.1-mbstring
- php-sqlite3
- php-apcu