bifrost/tools/vagrant_dev_env/vagrant.yml
Cédric Ollivier 11e514c543 Fix tools/vagrant_dev_env/vagrant.yml
It sets the correct working dir when calling scripts/env-setup.sh.
It also stops sourcing /opt/stack/ansible/hacking/env-setup as it is
no longer needed.

It currently conforms with README.rst.

Change-Id: If921b6b0df98d9e4e725b79168fbb3f500939362
Signed-off-by: Cédric Ollivier <ollivier.cedric@gmail.com>
2017-07-25 11:07:30 +02:00

90 lines
2.9 KiB
YAML

---
###############################################################################
#
#
- hosts: bifrost
become: yes
tasks:
############################################################################
# Install some reqired bits into the vm
############################################################################
# Make sure our VM's software is ~@Latest
- name: Apt Update
apt: update_cache=yes
upgrade=dist
cache_valid_time=86400
when: ansible_distribution == 'Ubuntu'
- name: Make sure distro setuptools is not there
apt: name=python-setuptools state=absent
when: ansible_distribution == 'Ubuntu'
- name: Download get-pip
get_url: url=https://bootstrap.pypa.io/get-pip.py
dest=/tmp/get-pip.py
- name: Install pip
shell: python /tmp/get-pip.py
- name: Install python-dev
apt: name=python-dev state=present
when: ansible_distribution == 'Ubuntu'
# these would also be installed by 'Prepare VM for Bifrost'
# below As they are larger packages I think its worth installing
# them on their own.
- name: Install erlang-base
apt: name=erlang-base state=present
when: ansible_distribution == 'Ubuntu'
- name: Install Rabbit-Server
apt: name=rabbitmq-server state=present
when: ansible_distribution == 'Ubuntu'
- name: Install MySql-Server
apt: name=mysql-server state=present
when: ansible_distribution == 'Ubuntu'
# get ip for public_network
- name: Get ip
shell: ip addr show eth2 | grep inet | grep -v inet6 | awk '{print $2}' | cut -d/ -f1
register: guest_ip
# Reboot if required.
- name: Reboot system if required
command: shutdown -r now 'Rebooting to complete system upgrade'
removes=/var/run/reboot-required
register: rebooted
- name: Wait for VM Reboot.
become: no
local_action: wait_for
port=22
host="{{guest_ip.stdout}}"
search_regex=OpenSSH
delay=10
timeout=900
when: rebooted.changed
- name: Copy SSH public key into VM
copy: src=~/.ssh/{{public_key}} dest=~/.ssh/id_rsa.pub
- name: Ensure /opt/stack folder exists
file: path=/opt/stack state=directory owner=vagrant
- name: Ensure ansible root folder exists
file: path={{ansible_install_root}} state=directory owner=vagrant
- name: Prepare VM for Bifrost
command: scripts/env-setup.sh
environment:
ANSIBLE_INSTALL_ROOT: "{{ansible_install_root}}"
args:
chdir: /home/vagrant/bifrost
- name: Install Bifrost
command: ansible-playbook -vvvv -i inventory/localhost install.yaml -e network_interface={{network_interface}}
environment:
PATH: "{{ansible_env.HOME}}/.local/bin:{{ansible_env.PATH}}"
args:
chdir: /home/vagrant/bifrost/playbooks