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

transports as resources. #178

Merged
merged 19 commits into from
Sep 25, 2015
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
22 changes: 5 additions & 17 deletions examples/hosts_file/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,20 @@
def run():
db.clear()

node1 = vr.create('node1', 'resources/ro_node', {'name': 'first' + str(time.time()),
'ip': '10.0.0.3',
'ssh_key': '/vagrant/.vagrant/machines/solar-dev1/virtualbox/private_key',
'ssh_user': 'vagrant'})[0]

node2 = vr.create('node2', 'resources/ro_node', {'name': 'second' + str(time.time()),
'ip': '10.0.0.4',
'ssh_key': '/vagrant/.vagrant/machines/solar-dev2/virtualbox/private_key',
'ssh_user': 'vagrant'})[0]


resources = vr.create('nodes', 'templates/nodes_with_transports.yaml', {'count': 2})
nodes = [x for x in resources if x.name.startswith('node')]
node1, node2 = nodes

hosts1 = vr.create('hosts_file1', 'resources/hosts_file', {})[0]
hosts2 = vr.create('hosts_file2', 'resources/hosts_file', {})[0]
signals.connect(node1, hosts1, {
'name': 'hosts:name',
'ip': ['hosts:ip', 'ip'],
'ssh_user': 'ssh_user',
'ssh_key': 'ssh_key'
'ip': 'hosts:ip',
})

signals.connect(node2, hosts2, {
'name': 'hosts:name',
'ip': ['hosts:ip', 'ip'],
'ssh_user': 'ssh_user',
'ssh_key': 'ssh_key'
'ip': 'hosts:ip',
})

signals.connect(node1, hosts2, {
Expand Down
12 changes: 5 additions & 7 deletions examples/openstack/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def setup_resources():
if PROFILE:
pr.enable()

node1, node2 = vr.create('nodes', 'templates/nodes.yaml', {})
resources = vr.create('nodes', 'templates/nodes_with_transports.yaml', {"count": 2})
nodes = [x for x in resources if x.name.startswith('node')]
node1, node2 = nodes


# MARIADB
mariadb_service1 = vr.create('mariadb_service1', 'resources/mariadb_service', {
Expand Down Expand Up @@ -247,8 +250,6 @@ def setup_resources():
signals.connect(neutron_keystone_user, neutron_keystone_role)
signals.connect(keystone_puppet, neutron_keystone_service_endpoint, {
'ip': ['ip', 'keystone_host'],
'ssh_key': 'ssh_key',
'ssh_user': 'ssh_user',
'admin_port': 'keystone_admin_port',
'admin_token': 'admin_token',
})
Expand Down Expand Up @@ -352,7 +353,6 @@ def setup_resources():
signals.connect(cinder_keystone_user, cinder_puppet, {'user_name': 'keystone_user', 'tenant_name': 'keystone_tenant', 'user_password': 'keystone_password'})
signals.connect(mariadb_service1, cinder_puppet, {'ip':'ip'})
signals.connect(cinder_puppet, cinder_keystone_service_endpoint, {
'ssh_key': 'ssh_key', 'ssh_user': 'ssh_user',
'ip': ['ip', 'keystone_host', 'admin_ip', 'internal_ip', 'public_ip'],
'port': ['admin_port', 'internal_port', 'public_port'],})
signals.connect(keystone_puppet, cinder_keystone_service_endpoint, {
Expand Down Expand Up @@ -447,8 +447,7 @@ def setup_resources():
signals.connect(nova_puppet, nova_keystone_service_endpoint, {
'ip': ['ip', 'keystone_host', 'public_ip', 'internal_ip', 'admin_ip'],
'port': ['admin_port', 'internal_port', 'public_port'],
'ssh_key': 'ssh_key',
'ssh_user': 'ssh_user'})
})

# NOVA API
nova_api_puppet = vr.create('nova_api_puppet', 'resources/nova_api_puppet', {})[0]
Expand Down Expand Up @@ -561,7 +560,6 @@ def setup_resources():
'user_password': 'keystone_password'})
signals.connect(mariadb_service1, glance_api_puppet, {'ip':'ip'})
signals.connect(glance_api_puppet, glance_keystone_service_endpoint, {
'ssh_key': 'ssh_key', 'ssh_user': 'ssh_user',
'ip': ['ip', 'keystone_host', 'admin_ip', 'internal_ip', 'public_ip'],
'bind_port': ['admin_port', 'internal_port', 'public_port'],})
signals.connect(keystone_puppet, glance_keystone_service_endpoint, {
Expand Down
3 changes: 2 additions & 1 deletion examples/riak/riaks.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
def setup_riak():
db.clear()

nodes = vr.create('nodes', 'templates/riak_nodes.yaml', {})
resources = vr.create('nodes', 'templates/riak_nodes.yaml', {'count': 3})
nodes = [x for x in resources if x.name.startswith('node')]
node1, node2, node3 = nodes

riak_services = []
Expand Down
12 changes: 6 additions & 6 deletions resources/ansible_remote/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ input:
ip:
type: str!
value:
ssh_user:
type: str!
value:
ssh_key:
type: str!
value:
# ssh_user:
# type: str!
# value:
# ssh_key:
# type: str!
# value:
default1:
type: str!
value: meta
12 changes: 6 additions & 6 deletions resources/apache_puppet/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ input:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
# ssh_key:
# schema: str!
# value:
# ssh_user:
# schema: str!
# value:

tags: [resource/apache_service, resources/apache]
12 changes: 6 additions & 6 deletions resources/cinder_api_puppet/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ input:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
# ssh_key:
# schema: str!
# value:
# ssh_user:
# schema: str!
# value:

tags: [resource/cinder_api_service, resources/cinder_api, resources/cinder]
12 changes: 6 additions & 6 deletions resources/cinder_glance_puppet/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ input:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
# ssh_key:
# schema: str!
# value:
# ssh_user:
# schema: str!
# value:

glance_api_servers_port:
schema: int
Expand Down
12 changes: 6 additions & 6 deletions resources/cinder_puppet/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ input:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
# ssh_key:
# schema: str!
# value:
# ssh_user:
# schema: str!
# value:

tags: [resource/cinder_service, resources/cinder]
12 changes: 6 additions & 6 deletions resources/cinder_scheduler_puppet/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ input:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
# ssh_key:
# schema: str!
# value:
# ssh_user:
# schema: str!
# value:

tags: [resource/cinder_scheduler_service, resources/cinder_scheduler, resources/cinder]
12 changes: 6 additions & 6 deletions resources/cinder_volume_puppet/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ input:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
# ssh_key:
# schema: str!
# value:
# ssh_user:
# schema: str!
# value:

tags: [resource/cinder_volume_service, resources/cinder_volume, resources/cinder]
12 changes: 6 additions & 6 deletions resources/container_networks/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ input:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
# ssh_key:
# schema: str!
# value:
# ssh_user:
# schema: str!
# value:
networks:
schema: {}
value:
12 changes: 6 additions & 6 deletions resources/docker/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ input:
ip:
schema: str!
value:
ssh_user:
schema: str!
value:
ssh_key:
schema: str!
value:
# ssh_user:
# schema: str!
# value:
# ssh_key:
# schema: str!
# value:

tags: [resources/docker]
12 changes: 6 additions & 6 deletions resources/docker_container/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ input:
volume_binds:
schema: [{src: str, dst: str, mode: str}]
value: []
ssh_user:
schema: str!
value: []
ssh_key:
schema: str!
value: []
# ssh_user:
# schema: str!
# value: []
# ssh_key:
# schema: str!
# value: []

tags: [resource/container]
12 changes: 6 additions & 6 deletions resources/glance_api_service/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ input:
volume_binds:
schema: [{src: str, dst: str, mode: str}]
value: []
ssh_user:
schema: str!
value: []
ssh_key:
schema: str!
value: []
# ssh_user:
# schema: str!
# value: []
# ssh_key:
# schema: str!
# value: []

db_password:
schema: str!
Expand Down
12 changes: 6 additions & 6 deletions resources/glance_config/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ input:
ip:
schema: str!
value:
ssh_user:
schema: str!
value: []
ssh_key:
schema: str!
value: []
# ssh_user:
# schema: str!
# value: []
# ssh_key:
# schema: str!
# value: []

config_dir:
schema: {src: str!, dst: str!, mode: str}
Expand Down
12 changes: 6 additions & 6 deletions resources/glance_puppet/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ input:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
# ssh_key:
# schema: str!
# value:
# ssh_user:
# schema: str!
# value:

db_user:
schema: str!
Expand Down
12 changes: 6 additions & 6 deletions resources/glance_registry_puppet/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ input:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
# ssh_key:
# schema: str!
# value:
# ssh_user:
# schema: str!
# value:

db_user:
schema: str!
Expand Down
12 changes: 6 additions & 6 deletions resources/glance_registry_service/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ input:
volume_binds:
schema: [{src: str, dst: str, mode: str}]
value: []
ssh_user:
schema: str!
value: []
ssh_key:
schema: str!
value: []
# ssh_user:
# schema: str!
# value: []
# ssh_key:
# schema: str!
# value: []

tags: [resource/container]
12 changes: 6 additions & 6 deletions resources/haproxy_config/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ input:
config:
schema: [{backends: [{server: str!, port: int!}], listen_port: int!, protocol: str!, name: str!}]
value: []
ssh_user:
schema: str!
value:
ssh_key:
schema: str!
value:
# ssh_user:
# schema: str!
# value:
# ssh_key:
# schema: str!
# value:

tags: [resources/haproxy, resource/haproxy_config]
Loading