Merge pull request #121 from Mirantis/cgenie/bootstrap-readme

Example-bootstrap: added readme, sample Vagrantfile
This commit is contained in:
CGenie 2015-09-16 16:53:44 +02:00
commit 64a549af6f
3 changed files with 26 additions and 19 deletions

View File

@ -0,0 +1,13 @@
# Demo of the `solar_bootstrap` Resource
You need to instantiate Vagrant with a slave node which is unprovisioned
(i.e. started from the `trusty64` Vagrant box).
You can start the boxes from the `Vagrantfile` in master directory and
`vagrant-settings.yml` from this directory.
Running
```bash
python example-bootstrap.py deploy
```
will deploy full Solar env to node `solar-dev2`.

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python
import click
import sys
import time
@ -12,19 +14,6 @@ from solar import errors
from solar.interfaces.db import get_db
GIT_PUPPET_LIBS_URL = 'https://github.com/CGenie/puppet-libs-resource'
# TODO
# Resource for repository OR puppet apt-module in run.pp
# add-apt-repository cloud-archive:juno
# To discuss: install stuff in Docker container
# NOTE
# No copy of manifests, pull from upstream (implemented in the puppet handler)
# Official puppet manifests, not fuel-library
db = get_db()
@ -38,15 +27,15 @@ def setup_resources():
signals.Connections.clear()
node3 = vr.create('node3', 'resources/ro_node/', {
'ip': '10.0.0.5',
'ssh_key': '/vagrant/.vagrant/machines/solar-dev3/virtualbox/private_key',
node2 = vr.create('node2', 'resources/ro_node/', {
'ip': '10.0.0.4',
'ssh_key': '/vagrant/.vagrant/machines/solar-dev2/virtualbox/private_key',
'ssh_user': 'vagrant'
})[0]
solar_bootstrap3 = vr.create('solar_bootstrap3', 'resources/solar_bootstrap', {'master_ip': '10.0.0.2'})[0]
solar_bootstrap2 = vr.create('solar_bootstrap2', 'resources/solar_bootstrap', {'master_ip': '10.0.0.2'})[0]
signals.connect(node3, solar_bootstrap3)
signals.connect(node2, solar_bootstrap2)
has_errors = False
for r in locals().values():
@ -63,7 +52,7 @@ def setup_resources():
sys.exit(1)
resources_to_run = [
'solar_bootstrap3',
'solar_bootstrap2',
]

View File

@ -0,0 +1,5 @@
# rename it to vagrant-settings.yml then Vagrantfile
# will use values from this file
slaves_count: 3
slaves_image: ubuntu/trusty64