-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_localhost.yml
More file actions
45 lines (37 loc) · 1.33 KB
/
setup_localhost.yml
File metadata and controls
45 lines (37 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
- name: Install Dokku
hosts: localhost
vars:
dns: dokku.me
ip: 10.88.0.8
tasks:
- name: Get current directory
shell: pwd
register: current_dir
- name: Install Virtualbox and Vagrant on MacOSX with Homebrew
shell: brew cask install {{ item }}
when: ansible_os_family == 'Darwin' and not {{ ansible_env.SKIP_INSTALL }}
sudo: yes
with_items:
- virtualbox
- vagrant
- vagrant-manager
- name: Install Virtualbox and Vagrant on Linux
package: name={{ item }} state=present
when: ansible_os_family not in ('Darwin', 'Windows') and not {{ ansible_env.SKIP_INSTALL }}
sudo: yes
with_items:
- virtualbox
- vagrant
- virtualbox-dkms
- name: Create Vagrantfile
template: src={{ current_dir.stdout }}/Vagrantfile.j2 dest={{ current_dir.stdout }}/Vagrantfile backup=yes
- name: Create test_hosts
template: src={{ current_dir.stdout }}/test_hosts.j2 dest={{ current_dir.stdout }}/test_hosts backup=yes
- name: Add dokku into hosts
lineinfile: dest=/etc/hosts line="{{ ip }} {{ dns }}"
sudo: yes
- name: Add alias into Bash Profile
lineinfile: dest='~/.bash_profile' line="alias dokkudev='ssh -t dokku@{{ dns }}'"
- name: Activate new Bash Profile
shell: source ~/.bash_profile