Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improving requirements for updates in the development guide #3

Merged
merged 3 commits into from
Jun 20, 2017
Merged
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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/playbook.retry
/scripts/playbook.retry
/.vagrant
/.idea
/.code
*.cmd
*.pyc
*.sln
*.sublime-project
*.sublime-workspace
*.suo
*.swp

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# manageiq-vagrant-dev
Vagrantfile and scripts so you can start a developer environment for ManageIQ Vagrant.
Vagrantfile and scripts to start a developer environment for ManageIQ Vagrant.

## Introduction ##
The script is currently designed in the following way:
Expand All @@ -12,20 +12,20 @@ The script is currently designed in the following way:

## The process ##

The Vagrant file will create a VM using fedora24-cloud as a basis and proceed to configure it for development:
- Configure the VM with 4 GB and 2 CPU
The Vagrant file will create a VM using fedora25-cloud as a basis and proceed to configure it for development:
- Configure the VM with 6 GB and 2 CPU
- Open port 3000 for UI management
- Open port 4000 for API management
- Copy the contents of ~/workspace/manageiq to /manageiq inside the appliance
- Install python (needed by Ansible) so the Ansible playbook.yml can be run
- Configure the OS and install everything needed for development
- Configure the database, start and enable it and add the user needed
- Configure rbenv and install ruby 2.3.1
- Configure rbenv and install ruby 2.4.1
- Verify if reboot is necessary and then reboot the machine

## Limitations ##
It won't run bin/setup to download the gems and run the database migration, so you can test them.
It won't execute rake evm:start to start the service that you will find in localhost:3000
It won't execute bin/rails evm:start to start the service that you will find in localhost:3000
Synchronization is only done once because the strategy is rsync (you need to call vagrant rsync to resynchronize)

## Adapting the Vagrantfile ##
Expand Down
11 changes: 6 additions & 5 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ Vagrant.configure(2) do |config|
# information on available options.

config.vm.provider "virtualbox" do |vb|
vb.memory = 4096
vb.memory = 6144
vb.cpus = 2
vb.name = "manageiq-dev"
end

config.vm.hostname = "vagrant-dev"
config.vm.hostname = "miqdev"

# There are bidirectional synchronization types that should be preferred if available
config.vm.synced_folder "~/workspace/manageiq/", "/manageiq", type: "rsync"
config.vm.synced_folder "~/workspace/manageiq/", "/home/vagrant/manageiq", type: "rsync"

# Install prerequisites for Ansible
config.vm.provision "shell", path: "scripts/initiation.sh"
Expand All @@ -95,9 +95,10 @@ Vagrant.configure(2) do |config|

config.vm.provision "shell", privileged: false, inline: <<-EOF
echo "Vagrant Box provisioned!"
echo "Local server address is http://localhost:3000"
echo "Please do $ vagrant ssh and cd to /manageiq"
echo "Please do $ vagrant ssh, your code will be in ~/manageiq"
echo "and do $ bin/setup to finish configuration"
echo "Server can be started with $ bundle exec rake evm:start"
echo "Local server address is http://localhost:3000"
echo "There is additional information in http://manageiq.org/docs/guides/developer_setup"
EOF
end
20 changes: 12 additions & 8 deletions scripts/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
- hosts: all
become: true
tasks:
- hostname: name=manageiq-dev
- name: change hostname
hostname:
name: miqdev
- name: install OS elements
dnf: name=* state=latest
- name: install OS packages for development
Expand All @@ -29,11 +31,14 @@
- cmake
- python-psycopg2
- libselinux-python
- git
- bash-completion
- vim
- name: install bower package manager
npm: name=bower global=yes
- name: install npm packages needed
npm: name={{ item }} global=yes
with_items:
- bower
- yarn
- webpack
- name: enable memcached and ensure is running
service: name=memcached state=started enabled=yes
- name: Initiate database
Expand Down Expand Up @@ -80,8 +85,7 @@
ignore_errors: yes
when: reboot_needed.stdout != ""
- name: waiting for server to come back
local_action: wait_for host={{ inventory_hostname }}
state=started
become: false
when: reboot_needed.stdout != ""
wait_for_connection:
delay: 60
timeout: 300
...