Fixes in client and solar inputs
This commit is contained in:
parent
5de8818efb
commit
3306bf83ed
11
Dockerfile
11
Dockerfile
@ -2,17 +2,17 @@ FROM ubuntu:14.04
|
||||
|
||||
WORKDIR /
|
||||
|
||||
RUN apt-get update
|
||||
# Install pip's dependency: setuptools:
|
||||
RUN apt-get install -y python python-dev python-distribute python-pip
|
||||
RUN pip install ansible
|
||||
|
||||
ADD bootstrap/playbooks/celery.yaml /celery.yaml
|
||||
ADD resources /resources
|
||||
ADD templates /templates
|
||||
ADD run.sh /run.sh
|
||||
ADD f2s /f2s
|
||||
|
||||
RUN apt-get update
|
||||
# Install pip's dependency: setuptools:
|
||||
RUN apt-get install -y python python-dev python-distribute python-pip \
|
||||
libyaml-dev vim libffi-dev libssl-dev
|
||||
RUN pip install ansible
|
||||
|
||||
RUN apt-get install -y libffi-dev libssl-dev
|
||||
|
||||
@ -20,6 +20,7 @@ RUN pip install https://github.com/Mirantis/solar/archive/master.zip
|
||||
RUN pip install https://github.com/Mirantis/solar-agent/archive/master.zip
|
||||
|
||||
RUN ansible-playbook -v -i "localhost," -c local /celery.yaml --tags install
|
||||
|
||||
RUN pip install riak peewee
|
||||
RUN pip install -U setuptools>=17.1
|
||||
RUN pip install -U python-fuelclient
|
||||
|
@ -14,8 +14,9 @@ class NailgunSource(object):
|
||||
|
||||
def nodes(self, uids):
|
||||
from fuelclient.objects.node import Node
|
||||
nodes_obj = map(Node, nodes)
|
||||
return [str(n.data['id']), str(n.data['ip']), str(n.data['cluster'])]
|
||||
nodes_obj = map(Node, uids)
|
||||
return [(str(n.data['id']), str(n.data['ip']), str(n.data['cluster']))
|
||||
for n in nodes_obj]
|
||||
|
||||
def roles(self, uid):
|
||||
from fuelclient.objects.node import Node
|
||||
@ -37,26 +38,28 @@ class DumbSource(object):
|
||||
def master(self):
|
||||
return 'master', '0.0.0.0'
|
||||
|
||||
source = DumbSource()
|
||||
source = NailgunSource()
|
||||
|
||||
@main.command()
|
||||
@click.argument('uids', nargs=-1)
|
||||
def nodes(uids):
|
||||
master = source.master()
|
||||
vr.create('master', 'f2s/vrs/fuel_node.yaml',
|
||||
{'index': master[0], 'ip': master[1]})
|
||||
for uid, ip, env in source.nodes(uids):
|
||||
vr.create('fuel_node', 'f2s/vrs/fuel_node.yaml',
|
||||
{'index': uid, 'ip': ip})
|
||||
|
||||
@main.command()
|
||||
@click.argument('uids', nargs=-1)
|
||||
def basic(uids):
|
||||
master_index = source.master()[0]
|
||||
def master():
|
||||
master = source.master()
|
||||
vr.create('master', 'f2s/vrs/fuel_node.yaml',
|
||||
{'index': master[0], 'ip': master[1]})
|
||||
|
||||
vr.create('genkeys', 'f2s/vrs/genkeys.yaml', {
|
||||
'node': 'node'+master_index,
|
||||
'index': master_index})
|
||||
'node': 'node'+master[0],
|
||||
'index': master[0]})
|
||||
|
||||
@main.command()
|
||||
@click.argument('uids', nargs=-1)
|
||||
def prep(uids):
|
||||
for uid, ip, env in source.nodes(uids):
|
||||
vr.create('prep', 'f2s/vrs/prep.yaml',
|
||||
{'index': uid, 'env': env, 'node': 'node'+uid})
|
||||
|
@ -1,5 +1,5 @@
|
||||
id: genkeys
|
||||
handler: bash
|
||||
handler: shell
|
||||
version: 0.0.1
|
||||
inputs:
|
||||
uid:
|
||||
|
@ -1,5 +1,6 @@
|
||||
id: fuel_node
|
||||
resources:
|
||||
{% for i in range(1|int) %}
|
||||
- id: ssh_transport{{index}}
|
||||
from: resources/transport_ssh
|
||||
values:
|
||||
@ -18,3 +19,4 @@ resources:
|
||||
name: node{{index}}
|
||||
ip: {{ip}}
|
||||
transports_id: transports{{index}}::transports_id
|
||||
{% endfor %}
|
||||
|
@ -234,7 +234,7 @@ class Resource(object):
|
||||
def resource_inputs(self):
|
||||
return self.db_obj.inputs
|
||||
|
||||
def to_dict(self, inputs=False):
|
||||
def to_dict(self, inputs=True):
|
||||
ret = self.db_obj.to_dict()
|
||||
if inputs:
|
||||
ret['inputs'] = self.db_obj.inputs.as_dict()
|
||||
|
@ -142,6 +142,7 @@ def create_resources(resources, tags=None):
|
||||
r = new_resources[0]
|
||||
node.connect(r, mapping={})
|
||||
r.add_tags('location={}'.format(node.name))
|
||||
|
||||
update_inputs(resource_name, args)
|
||||
|
||||
if values_from:
|
||||
|
Loading…
x
Reference in New Issue
Block a user