Skip to content

Instantly share code, notes, and snippets.

@eiri
Last active December 20, 2016 06:48
Show Gist options
  • Save eiri/9cd3fa8ea16556a3016b85dca5441b96 to your computer and use it in GitHub Desktop.
Save eiri/9cd3fa8ea16556a3016b85dca5441b96 to your computer and use it in GitHub Desktop.
Ubuntu 14.04 for Swift 3.0.2 - simple dev environment
.vagrant/
git/
---
- hosts: all
remote_user: vagrant
become: yes
tasks:
- name: update packages dist
apt:
update_cache: yes
- name: install all packages
apt:
name: "{{item}}"
state: present
with_items:
- git
- build-essential
- make
- cmake
- autoconf
- automake
- clang
- libicu-dev
- libncurses5-dev
- libssl-dev
- uuid-dev
- curl
- wget
- vim
- tree
- multitail
- name: install swift
unarchive:
src: https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
dest: /opt
copy: no
creates: /opt/swift-3.0.2-RELEASE-ubuntu14.04
- name: fix swift stupid chown issue
file:
path: /opt/swift-3.0.2-RELEASE-ubuntu14.04
mode: u=rwX,g=rX,o=rX
recurse: yes
- name: update .bash_aliases
become_user: vagrant
lineinfile:
dest: /home/vagrant/.bash_aliases
line: 'alias lt="ls -Gltr"'
mode: 0644
state: present
create: yes
- name: add local ~/bin
become_user: vagrant
file:
path: /home/vagrant/bin
state: directory
mode: 0755
- name: add swift into $PATH
become_user: vagrant
lineinfile:
dest: /home/vagrant/.profile
line: export PATH=/opt/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin:$PATH
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-14.04"
config.vm.box_check_update = true
config.vm.hostname = "swiftly.dev"
config.ssh.shell = "/bin/bash"
config.vm.network "private_network", ip: '192.168.10.2'
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "git/", "/home/vagrant/git", type: "nfs", mount_options: ["nolock", "vers=3", "tcp", "noatime", "actimeo=1"]
config.vm.provider "virtualbox" do |vb|
vb.name = "swiftly"
vb.gui = false
vb.cpus = 1
vb.memory = 4096
vb.customize ["modifyvm", :id, "--vram", "9"]
vb.customize ["modifyvm", :id, "--vrde", "off"]
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "provision.yml"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment