Created
February 27, 2016 22:58
-
-
Save pdvyas/e2a4a68a76feb4940390 to your computer and use it in GitHub Desktop.
VM build server playbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
user: root | |
become: yes | |
become_user: root | |
tasks: | |
- name: Set hostname | |
hostname: name={{ hostname }} | |
- name: install packages | |
apt: pkg={{ item }} state=present | |
with_items: | |
- vim | |
- git-core | |
- nginx | |
- virtualbox | |
when: ansible_os_family == 'Debian' | |
- name: Setup users | |
hosts: all | |
user: root | |
tasks: | |
- name: Add frappe user | |
user: name=frappe shell=/bin/bash | |
- name: Add your own key | |
authorized_key: user=frappe key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}" | |
- name: Add your own key | |
authorized_key: user=root key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}" | |
- name: Setup bench | |
hosts: all | |
user: frappe | |
gather_facts: False | |
tasks: | |
- name: Clone bench | |
git: | |
accept_hostkey=True | |
repo=https://github.com/frappe/bench | |
dest=/home/frappe/bench | |
- name: Download base.ova | |
get_url: url=https://github.com/pdvyas/deploy-erpnext/releases/download/0.02/base.ova dest=/home/frappe/bench/vm/base.ova | |
- name: Download base.ova | |
get_url: url=https://github.com/pdvyas/deploy-erpnext/releases/download/0.02/base.ova dest=/home/frappe/bench/vm/base.ova | |
- name: Make public dir | |
file: path=/home/frappe/ state=directory | |
- name: Setup nginx | |
hosts: all | |
user: root | |
become: yes | |
become_user: root | |
tasks: | |
- name: Remove default nginx conf | |
file: path=/etc/nginx/sites-enabled/default.conf state=absent | |
- name: Copy nginx config | |
copy: src=vm.nginx.conf dest=/etc/nginx/conf.d/vm.conf | |
- service: name=nginx enabled=yes state=reloaded | |
## TODO: Change the path to base.ova and add https (letsencrypt) |
yeah, it's 500M can't put that in the repo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why do you need to do get_url base.ova? Isn't the VM build script self sufficient? If not, shouldn't the base.ova be part of the bench/vm folder?