diff --git a/examples/cli/example.sh b/examples/cli/example.sh index 2319779..6f86fde 100755 --- a/examples/cli/example.sh +++ b/examples/cli/example.sh @@ -5,7 +5,7 @@ function deploy { # this two commands will clean db solar resource clear_all - solar resource create nodes templates/nodes.yaml '{"count": 1}' + solar resource create nodes templates/nodes '{"count": 1}' solar resource create mariadb1 /vagrant/resources/mariadb_service image=mariadb port=3306 solar connect node1 mariadb1 diff --git a/examples/hosts_file/hosts.py b/examples/hosts_file/hosts.py index 19342ce..ecce195 100644 --- a/examples/hosts_file/hosts.py +++ b/examples/hosts_file/hosts.py @@ -10,7 +10,7 @@ from solar.dblayer.model import ModelMeta def run(): ModelMeta.remove_all() - resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 2}) + resources = vr.create('nodes', 'templates/nodes', {'count': 2}) node1, node2 = [x for x in resources if x.name.startswith('node')] hosts1, hosts2 = [x for x in resources diff --git a/examples/librarian/README b/examples/librarian/README index ca51c47..20b1caa 100644 --- a/examples/librarian/README +++ b/examples/librarian/README @@ -5,7 +5,7 @@ Run it from /vagrant dir: ``` solar resource clear_all -solar resource create nodes templates/nodes.yaml '{"count": 1}' +solar resource create nodes templates/nodes '{"count": 1}' solar resource create librarian_example examples/librarian/librarian.yaml '{"node": "node1"}' solar changes stage diff --git a/examples/library_ceph/README.md b/examples/library_ceph/README.md index 1e19af4..97e6cc4 100644 --- a/examples/library_ceph/README.md +++ b/examples/library_ceph/README.md @@ -26,5 +26,5 @@ solar res action run ceph_mon1 To add repositories use ``` -solar resource create apt1 templates/mos_repos.yaml node=node1 index=1 +solar resource create apt1 templates/mos_repos node=node1 index=1 ``` diff --git a/examples/library_ceph/ceph.py b/examples/library_ceph/ceph.py index 78d93e5..f6f11d2 100644 --- a/examples/library_ceph/ceph.py +++ b/examples/library_ceph/ceph.py @@ -33,7 +33,7 @@ NETWORK_METADATA = yaml.load(""" def deploy(): ModelMeta.remove_all() - resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 2}) + resources = vr.create('nodes', 'templates/nodes', {'count': 2}) first_node, second_node = [x for x in resources if x.name.startswith('node')] first_transp = next(x for x in resources if x.name.startswith('transport')) @@ -60,7 +60,7 @@ def deploy(): })[0] managed_apt = vr.create( - 'managed_apt1', 'templates/mos_repos.yaml', + 'managed_apt1', 'templates/mos_repos', {'node': first_node.name, 'index': 0})[-1] keys.connect(ceph_mon, {}) diff --git a/examples/lxc/example-lxc.py b/examples/lxc/example-lxc.py index 01d6c7b..43d9e1f 100755 --- a/examples/lxc/example-lxc.py +++ b/examples/lxc/example-lxc.py @@ -45,8 +45,8 @@ def lxc_template(idx): def deploy(): ModelMeta.remove_all() - node1 = vr.create('nodes', 'templates/nodes.yaml', {})[0] - seed = vr.create('nodes', 'templates/seed_node.yaml', {})[0] + node1 = vr.create('nodes', 'templates/nodes', {})[0] + seed = vr.create('nodes', 'templates/seed_node', {})[0] ssh_key = vr.create('ssh_key1', 'resources/ssh_key', { 'keys_dir': '/vagrant/.ssh', diff --git a/examples/openstack/openstack.py b/examples/openstack/openstack.py index 8f0d28d..502aa7a 100755 --- a/examples/openstack/openstack.py +++ b/examples/openstack/openstack.py @@ -40,9 +40,9 @@ def main(): def prepare_nodes(nodes_count): - resources = vr.create('nodes', 'templates/nodes_with_transports.yaml', {"count": nodes_count}) + resources = vr.create('nodes', 'templates/nodes_with_transports', {"count": nodes_count}) nodes = [x for x in resources if x.name.startswith('node')] - resources = vr.create('nodes_network', 'templates/nodes_network.yaml', {"count": nodes_count}) + resources = vr.create('nodes_network', 'templates/nodes_network', {"count": nodes_count}) nodes_sdn = [x for x in resources if x.name.startswith('node')] r = {} diff --git a/examples/provisioning/provision.py b/examples/provisioning/provision.py index f9b6bd2..14c88c6 100755 --- a/examples/provisioning/provision.py +++ b/examples/provisioning/provision.py @@ -40,7 +40,7 @@ requests.post(bareon_sync) nodes_list = requests.get(discovery_service).json() # Create slave node resources -node_resources = vr.create('nodes', 'templates/not_provisioned_nodes.yaml', +node_resources = vr.create('nodes', 'templates/not_provisioned_nodes', {'nodes': nodes_list}) # Get master node diff --git a/examples/riak/riak_cluster.yaml b/examples/riak/riak_cluster.yaml index 98143d1..277ab22 100644 --- a/examples/riak/riak_cluster.yaml +++ b/examples/riak/riak_cluster.yaml @@ -30,21 +30,21 @@ resources: riaks: ['riak_service1', 'riak_service2', 'riak_service3'] - id: haproxy1 - from: templates/haproxy.yaml + from: templates/haproxy values: node: {{nodes[0]}} service_configs: ['haproxy_riak_config_pb', 'haproxy_riak_config_http'] index: 1 - id: haproxy2 - from: templates/haproxy.yaml + from: templates/haproxy values: node: {{nodes[1]}} service_configs: ['haproxy_riak_config_pb', 'haproxy_riak_config_http'] index: 2 - id: haproxy3 - from: templates/haproxy.yaml + from: templates/haproxy values: node: {{nodes[2]}} service_configs: ['haproxy_riak_config_pb', 'haproxy_riak_config_http'] diff --git a/examples/riak/riaks-template.py b/examples/riak/riaks-template.py index 13e49ed..2c75d86 100755 --- a/examples/riak/riaks-template.py +++ b/examples/riak/riaks-template.py @@ -15,7 +15,7 @@ from solar.dblayer.model import ModelMeta def setup_riak(): ModelMeta.remove_all() - nodes = template.nodes_from('templates/riak_nodes.yaml') + nodes = template.nodes_from('templates/riak_nodes') riak_services = nodes.on_each( 'resources/riak_node', diff --git a/examples/riak/riaks.py b/examples/riak/riaks.py index 4c43d1e..afe3c52 100755 --- a/examples/riak/riaks.py +++ b/examples/riak/riaks.py @@ -31,7 +31,7 @@ from solar.dblayer.solar_models import Resource def setup_riak(): ModelMeta.remove_all() - resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 3}) + resources = vr.create('nodes', 'templates/nodes', {'count': 3}) nodes = [x for x in resources if x.name.startswith('node')] hosts_services = [x for x in resources if x.name.startswith('hosts_file')] node1, node2, node3 = nodes diff --git a/examples/riak/riaks_big.py b/examples/riak/riaks_big.py index e084fbc..9525f3d 100755 --- a/examples/riak/riaks_big.py +++ b/examples/riak/riaks_big.py @@ -28,7 +28,7 @@ def setup_riak(nodes_num=None, hosts_mapping=False): nodes_num = NODES db.clear() - resources = vr.create('nodes', 'templates/nodes.yaml', {'count': nodes_num}) + resources = vr.create('nodes', 'templates/nodes', {'count': nodes_num}) nodes = [x for x in resources if x.name.startswith('node')] hosts_services = [x for x in resources if x.name.startswith('hosts_file')] diff --git a/templates/controller/1.0.0/controller.yaml b/templates/controller/1.0.0/controller.yaml index b2a908e..5d34bc6 100644 --- a/templates/controller/1.0.0/controller.yaml +++ b/templates/controller/1.0.0/controller.yaml @@ -19,7 +19,7 @@ resources: ssh_key: '#{ssh_key}#' - id: keystone_base - from: templates/keystone_base.yaml + from: templates/keystone_base values: login_user: root login_password: 'mariadb_service::root_password' @@ -33,7 +33,7 @@ resources: ssh_key: '#{ssh_key}#' - id: keystone_api_1 - from: templates/keystone_api.yaml + from: templates/keystone_api values: idx: 1 db_password: 'keystone_db_user::user_password' @@ -49,7 +49,7 @@ resources: ssh_key: '#{ssh_key}#' - id: openstack_base - from: templates/openstack_base.yaml + from: templates/openstack_base values: ip: '#{ip}#' ssh_user: '#{ssh_user}#' diff --git a/templates/glance/1.0.0/glance.yaml b/templates/glance/1.0.0/glance.yaml index 7d28bbe..475b20a 100644 --- a/templates/glance/1.0.0/glance.yaml +++ b/templates/glance/1.0.0/glance.yaml @@ -2,7 +2,7 @@ id: glance_#{idx}# resources: - id: glance_base_#{ idx }# - from: templates/glance_db.yaml + from: templates/glance_db values: idx: '#{ idx }#'