diff --git a/solar/core/resource/virtual_resource.py b/solar/core/resource/virtual_resource.py index c3825b7f..d2dcc3b5 100644 --- a/solar/core/resource/virtual_resource.py +++ b/solar/core/resource/virtual_resource.py @@ -32,8 +32,10 @@ from solar.events.controls import React # Custom environment with custom blocks, to make yaml parsers happy -VR_ENV = Environment(block_end_string="#%", - block_start_string="%#", +VR_ENV = Environment(block_start_string="#%", + block_end_string="%#", + variable_start_string="#{", + variable_end_string="}#", trim_blocks=True, lstrip_blocks=True) @@ -106,9 +108,8 @@ def _compile_file(name, path, kwargs): def get_inputs(content): - env = Environment(trim_blocks=True, lstrip_blocks=True) - jinja_globals = env.globals.keys() - ast = env.parse(content) + jinja_globals = VR_ENV.globals.keys() + ast = VR_ENV.parse(content) return meta.find_undeclared_variables(ast) - set(jinja_globals) diff --git a/templates/controller.yaml b/templates/controller.yaml index 24feb761..b2a908e3 100644 --- a/templates/controller.yaml +++ b/templates/controller.yaml @@ -7,16 +7,16 @@ resources: port: 3306 root_password: mariadb image: mariadb - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: rabbitmq_service from: resources/rabbitmq_service values: - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: keystone_base from: templates/keystone_base.yaml @@ -28,9 +28,9 @@ resources: db_host: 'mariadb_service::ip' user_password: 'keystone' user_name: 'keystone' - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: keystone_api_1 from: templates/keystone_api.yaml @@ -44,16 +44,16 @@ resources: admin_token: 132fdsfwqee admin_port: 35357 port: 5000 - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: openstack_base from: templates/openstack_base.yaml values: - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' keystone_ip: 'keystone_service_1::ip' keystone_admin_port: 'keystone_service_1::admin_port' keystone_port: 'keystone_service_1::port' @@ -68,9 +68,9 @@ resources: user_name: 'admin_user::user_name' password: 'admin_user::user_password' - ip: '{{ip}}' - ssh_key: '{{ssh_key}}' - ssh_user: '{{ssh_user}}' + ip: '#{ip}#' + ssh_key: '#{ssh_key}#' + ssh_user: '#{ssh_user}#' tags: ['resources/controller', 'resource/primary_controller'] diff --git a/templates/glance.yaml b/templates/glance.yaml index 72705af9..7d28bbec 100644 --- a/templates/glance.yaml +++ b/templates/glance.yaml @@ -1,22 +1,22 @@ -id: glance_{{idx}} +id: glance_#{idx}# resources: - - id: glance_base_{{ idx }} + - id: glance_base_#{ idx }# from: templates/glance_db.yaml values: - idx: '{{ idx }}' + idx: '#{ idx }#' - db_name: '{{ db_name }}' - db_user: '{{ db_user }}' - db_password: '{{ db_password }}' - db_host: '{{ db_host }}' - db_login_port: '{{ db_port }}' - db_login_user: '{{ db_login_user }}' - db_login_password: '{{ db_login_password }}' + db_name: '#{ db_name }#' + db_user: '#{ db_user }#' + db_password: '#{ db_password }#' + db_host: '#{ db_host }#' + db_login_port: '#{ db_port }#' + db_login_user: '#{ db_login_user }#' + db_login_password: '#{ db_login_password }#' - ip: '{{ ip }}' - ssh_user: '{{ ssh_user }}' - ssh_key: '{{ ssh_key }}' + ip: '#{ ip }#' + ssh_user: '#{ ssh_user }#' + ssh_key: '#{ ssh_key }#' tags: ['resources/glance', 'resource/glance_api', 'resource/glance_registry'] diff --git a/templates/glance_base.yaml b/templates/glance_base.yaml index 98a293a0..ab11e606 100644 --- a/templates/glance_base.yaml +++ b/templates/glance_base.yaml @@ -4,19 +4,19 @@ resources: - id: glance_db from: resources/mariadb_db values: - db_name: {{db_name}} - login_user: '{{login_user}}' - login_password: '{{login_password}}' - login_port: '{{login_port}}' - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + db_name: #{db_name}# + login_user: '#{login_user}#' + login_password: '#{login_password}#' + login_port: '#{login_port}#' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: glance_db_user from: resources/mariadb_user values: - user_password: '{{user_password}}' - user_name: '{{user_name}}' + user_password: '#{user_password}#' + user_name: '#{user_name}#' db_name: 'keystone_db::db_name' login_user: 'keystone_db::login_user' login_password: 'keystone_db::login_password' diff --git a/templates/glance_db.yaml b/templates/glance_db.yaml index 701b3911..6f750fed 100644 --- a/templates/glance_db.yaml +++ b/templates/glance_db.yaml @@ -1,30 +1,30 @@ -id: glance_db_{{ idx }} +id: glance_db_#{ idx }# resources: - - id: glance_db_db_{{ idx }} + - id: glance_db_db_#{ idx }# from: resources/mariadb_db values: - db_name: '{{ db_name }}' - login_user: '{{ db_login_user }}' - login_password: '{{ db_login_password }}' - login_port: '{{ db_login_port }}' + db_name: '#{ db_name }#' + login_user: '#{ db_login_user }#' + login_password: '#{ db_login_password }#' + login_port: '#{ db_login_port }#' - ip: '{{ ip }}' - ssh_user: '{{ ssh_user }}' - ssh_key: '{{ ssh_key }}' + ip: '#{ ip }#' + ssh_user: '#{ ssh_user }#' + ssh_key: '#{ ssh_key }#' - id: glance_db_user from: resources/mariadb_user values: - user_password: '{{ db_password }}' - user_name: '{{ db_user }}' + user_password: '#{ db_password }#' + user_name: '#{ db_user }#' - db_name: '{{ db_name }}' + db_name: '#{ db_name }#' - login_user: '{{ db_login_user }}' - login_password: '{{ db_login_password }}' - login_port: '{{ db_login_port }}' + login_user: '#{ db_login_user }#' + login_password: '#{ db_login_password }#' + login_port: '#{ db_login_port }#' - ip: '{{ ip }}' - ssh_user: '{{ ssh_user }}' - ssh_key: '{{ ssh_key }}' + ip: '#{ ip }#' + ssh_user: '#{ ssh_user }#' + ssh_key: '#{ ssh_key }#' diff --git a/templates/glance_registry.yaml b/templates/glance_registry.yaml index b86a781e..c5bbff8f 100644 --- a/templates/glance_registry.yaml +++ b/templates/glance_registry.yaml @@ -1,26 +1,26 @@ -id: glance_register_{{idx}} +id: glance_register_#{idx}# resources: - - id: glance_config_{{idx}} + - id: glance_config_#{idx}# from: resources/glance_config values: - keystone_admin_port: '{{keystone_admin_port}}' - keystone_ip: '{{keystone_ip}}' - mysql_password: '{{mysql_password}}' - mysql_user: '{{mysql_user}}' - mysql_db: '{{mysql_db}}' - mysql_ip: '{{mysql_ip}}' - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + keystone_admin_port: '#{keystone_admin_port}#' + keystone_ip: '#{keystone_ip}#' + mysql_password: '#{mysql_password}#' + mysql_user: '#{mysql_user}#' + mysql_db: '#{mysql_db}#' + mysql_ip: '#{mysql_ip}#' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - - id: glance_registry_{{idx}} + - id: glance_registry_#{idx}# from: resources/glance_registry_service values: - ip: 'keystone_config_{{idx}}::ip' - ssh_user: 'keystone_config_{{idx}}::ssh_user' - ssh_key: 'keystone_config_{{idx}}::ssh_key' + ip: 'keystone_config_#{idx}#::ip' + ssh_user: 'keystone_config_#{idx}#::ssh_user' + ssh_key: 'keystone_config_#{idx}#::ssh_key' tags: ['resources/keystone', 'resource/keystone_api'] diff --git a/templates/haproxy.yaml b/templates/haproxy.yaml index 7e9e602a..15037f28 100644 --- a/templates/haproxy.yaml +++ b/templates/haproxy.yaml @@ -1,46 +1,46 @@ id: haproxy resources: - - id: haproxy_config{{index}} + - id: haproxy_config#{index}# from: resources/haproxy_config - location: {{node}} + location: #{node}# values: - ip: '{{node}}::ip' + ip: '#{node}#::ip' config:protocol: #% for config in service_configs %# - - {{config}}::protocol + - #{config}#::protocol #% endfor %# config:listen_port: #% for config in service_configs %# - - {{config}}::listen_port + - #{config}#::listen_port #% endfor %# config:name: #% for config in service_configs %# - - {{config}}::name + - #{config}#::name #% endfor %# config:backends: #% for config in service_configs %# - - {{config}}::backends + - #{config}#::backends #% endfor %# - - id: haproxy_service{{index}} - location: {{node}} + - id: haproxy_service#{index}# + location: #{node}# from: resources/haproxy_service values: - ip: '{{node}}::ip' + ip: '#{node}#::ip' events: - type: depends_on - parent_action: 'haproxy_service{{index}}.run' + parent_action: 'haproxy_service#{index}#.run' state: 'success' - depend_action: 'haproxy_config{{index}}.run' + depend_action: 'haproxy_config#{index}#.run' - type: react_on - parent_action: 'haproxy_config{{index}}.run' + parent_action: 'haproxy_config#{index}#.run' state: 'success' - depend_action: 'haproxy_service{{index}}.apply_config' + depend_action: 'haproxy_service#{index}#.apply_config' - type: react_on - parent_action: 'haproxy_config{{index}}.update' + parent_action: 'haproxy_config#{index}#.update' state: 'success' - depend_action: 'haproxy_service{{index}}.apply_config' + depend_action: 'haproxy_service#{index}#.apply_config' diff --git a/templates/keystone_api.yaml b/templates/keystone_api.yaml index a37804cf..4b894482 100644 --- a/templates/keystone_api.yaml +++ b/templates/keystone_api.yaml @@ -1,20 +1,20 @@ -id: keystone_api_{{idx}} +id: keystone_api_#{idx}# resources: - - id: keystone_service_{{idx}} + - id: keystone_service_#{idx}# from: resources/keystone_puppet values: - admin_token: '{{admin_token}}' - db_host: '{{db_host}}' - db_name: '{{db_name}}' - db_user: '{{db_user}}' - db_password: '{{db_password}}' + admin_token: '#{admin_token}#' + db_host: '#{db_host}#' + db_name: '#{db_name}#' + db_user: '#{db_user}#' + db_password: '#{db_password}#' - admin_port: {{admin_port}} - port: {{port}} - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + admin_port: #{admin_port}# + port: #{port}# + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' tags: ['resources/keystone', 'resource/keystone_api'] diff --git a/templates/keystone_base.yaml b/templates/keystone_base.yaml index 330bb5b7..d7fa4f41 100644 --- a/templates/keystone_base.yaml +++ b/templates/keystone_base.yaml @@ -4,22 +4,22 @@ resources: - id: keystone_db from: resources/mariadb_db values: - db_name: '{{db_name}}' - db_host: '{{db_host}}' - login_user: '{{login_user}}' - login_password: '{{login_password}}' - login_port: '{{login_port}}' - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + db_name: '#{db_name}#' + db_host: '#{db_host}#' + login_user: '#{login_user}#' + login_password: '#{login_password}#' + login_port: '#{login_port}#' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: keystone_db_user from: resources/mariadb_user values: - user_password: '{{user_password}}' - user_name: '{{user_name}}' + user_password: '#{user_password}#' + user_name: '#{user_name}#' db_name: 'keystone_db::db_name' - db_host: '{{db_host}}' + db_host: '#{db_host}#' login_user: 'keystone_db::login_user' login_password: 'keystone_db::login_password' login_port: 'keystone_db::login_port' diff --git a/templates/mos_repos.yaml b/templates/mos_repos.yaml index e08e0b8c..f4409402 100644 --- a/templates/mos_repos.yaml +++ b/templates/mos_repos.yaml @@ -1,43 +1,43 @@ id: mos_repos resources: - - id: mos_holdback_{{index}} + - id: mos_holdback_#{index}# from: resources/apt_repo - location: {{node}} + location: #{node}# values: name: mos-holdback package: '*' repo: deb http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0/ mos8.0-holdback main restricted pin: release o=Mirantis,n=mos8.0,a=mos8.0-holdback,l=mos8.0 pin_priority: 1100 - - id: mos_security_{{index}} + - id: mos_security_#{index}# from: resources/apt_repo - location: {{node}} + location: #{node}# values: name: mos package: '*' repo: deb http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0/ mos8.0-security main restricted pin: release o=Mirantis,n=mos8.0,a=mos8.0-security,l=mos8.0 pin_priority: 1050 - - id: mos_updates_{{index}} + - id: mos_updates_#{index}# from: resources/apt_repo - location: {{node}} + location: #{node}# values: name: mos_update package: '*' repo: deb http://mirror.fuel-infra.org/mos-repos/ubuntu/8.0/ mos8.0-updates main restricted pin: release o=Mirantis,a=mos8.0-updates,l=mos8.0,n=mos8.0 pin_priority: 1050 - - id: managed_apt_{{index}} + - id: managed_apt_#{index}# from: resources/managed_apt - location: {{node}} + location: #{node}# values: names: - - mos_holdback_{{index}}::name - - mos_security_{{index}}::name - - mos_updates_{{index}}::name + - mos_holdback_#{index}#::name + - mos_security_#{index}#::name + - mos_updates_#{index}#::name repos: - - mos_holdback_{{index}}::repo - - mos_security_{{index}}::repo - - mos_updates_{{index}}::repo + - mos_holdback_#{index}#::repo + - mos_security_#{index}#::repo + - mos_updates_#{index}#::repo ensure_other_removed: false diff --git a/templates/nodes.yaml b/templates/nodes.yaml index 5455cb97..4f21eba2 100644 --- a/templates/nodes.yaml +++ b/templates/nodes.yaml @@ -2,36 +2,36 @@ id: simple_riak_with_transports resources: #% for i in range(count|int) %# #% set j = i +1 %# - - id: ssh_transport{{j}} + - id: ssh_transport#{j}# from: resources/transport_ssh values: ssh_user: 'vagrant' - ssh_key: '/vagrant/.vagrant/machines/solar-dev{{j}}/virtualbox/private_key' - - id: rsync{{j}} + ssh_key: '/vagrant/.vagrant/machines/solar-dev#{j}#/virtualbox/private_key' + - id: rsync#{j}# from: resources/transport_rsync values: user: vagrant - key: /vagrant/.vagrant/machines/solar-dev{{j}}/virtualbox/private_key - - id: transports{{j}} + key: /vagrant/.vagrant/machines/solar-dev#{j}#/virtualbox/private_key + - id: transports#{j}# from: resources/transports values: transports: - - key: ssh_transport{{j}}::ssh_key - user: ssh_transport{{j}}::ssh_user - port: ssh_transport{{j}}::ssh_port - name: ssh_transport{{j}}::name - - key: rsync{{j}}::key - name: rsync{{j}}::name - user: rsync{{j}}::user - port: rsync{{j}}::port - - id: node{{j}} + - key: ssh_transport#{j}#::ssh_key + user: ssh_transport#{j}#::ssh_user + port: ssh_transport#{j}#::ssh_port + name: ssh_transport#{j}#::name + - key: rsync#{j}#::key + name: rsync#{j}#::name + user: rsync#{j}#::user + port: rsync#{j}#::port + - id: node#{j}# from: resources/ro_node values: - name: node{{j}} - ip: '10.0.0.{{i + 3}}' - transports_id: transports{{j}}::transports_id - - id: hosts_file{{j}} + name: node#{j}# + ip: '10.0.0.#{i + 3}#' + transports_id: transports#{j}#::transports_id + - id: hosts_file#{j}# from: resources/hosts_file - location: node{{j}} - tags: ['location=node{{j}}'] + location: node#{j}# + tags: ['location=node#{j}#'] #% endfor %# diff --git a/templates/nodes_network.yaml b/templates/nodes_network.yaml index 3d2a88d8..32452105 100644 --- a/templates/nodes_network.yaml +++ b/templates/nodes_network.yaml @@ -4,7 +4,7 @@ id: simple_multinode_gre # eth3 - ext 10.2.0.0/24 resources: #% for i in range(count|int) %# - - id: node{{i}}_sdn + - id: node#{i}#_sdn from: resources/node_network_puppet values: use_ovs: true @@ -46,18 +46,18 @@ resources: endpoints: br-mesh: IP: - - 10.1.0.{{3 + i}}/24 + - 10.1.0.#{3 + i}#/24 br-floating: IP: none br-mgmt: IP: - - 10.0.0.{{3 + i}}/24 + - 10.0.0.#{3 + i}#/24 vendor_specific: phy_interfaces: - eth1 br-ex: IP: - - 10.2.0.{{3 + i}}/24 + - 10.2.0.#{3 + i}#/24 vendor_specific: phy_interfaces: - eth3 diff --git a/templates/nodes_with_transports.yaml b/templates/nodes_with_transports.yaml index 7d56bf9f..62796498 100644 --- a/templates/nodes_with_transports.yaml +++ b/templates/nodes_with_transports.yaml @@ -1,32 +1,32 @@ id: simple_multinode_with_transports resources: #% for i in range(count|int) %# - - id: ssh_transport{{i}} + - id: ssh_transport#{i}# from: resources/transport_ssh values: ssh_user: 'vagrant' - ssh_key: '/vagrant/.vagrant/machines/solar-dev{{i + 1}}/virtualbox/private_key' - - id: rsync{{i}} + ssh_key: '/vagrant/.vagrant/machines/solar-dev#{i + 1}#/virtualbox/private_key' + - id: rsync#{i}# from: resources/transport_rsync values: user: vagrant - key: /vagrant/.vagrant/machines/solar-dev{{i + 1}}/virtualbox/private_key - - id: transports{{i}} + key: /vagrant/.vagrant/machines/solar-dev#{i + 1}#/virtualbox/private_key + - id: transports#{i}# from: resources/transports values: transports: - - key: ssh_transport{{i}}::ssh_key - user: ssh_transport{{i}}::ssh_user - port: ssh_transport{{i}}::ssh_port - name: ssh_transport{{i}}::name - - key: rsync{{i}}::key - name: rsync{{i}}::name - user: rsync{{i}}::user - port: rsync{{i}}::port - - id: node{{i}} + - key: ssh_transport#{i}#::ssh_key + user: ssh_transport#{i}#::ssh_user + port: ssh_transport#{i}#::ssh_port + name: ssh_transport#{i}#::name + - key: rsync#{i}#::key + name: rsync#{i}#::name + user: rsync#{i}#::user + port: rsync#{i}#::port + - id: node#{i}# from: resources/ro_node values: - ip: '10.0.0.{{i + 3}}' - transports_id: transports{{i}}::transports_id - name: node{{i}} + ip: '10.0.0.#{i + 3}#' + transports_id: transports#{i}#::transports_id + name: node#{i}# #% endfor %# diff --git a/templates/not_provisioned_nodes.yaml b/templates/not_provisioned_nodes.yaml index 6d5e78e0..96e1110f 100644 --- a/templates/not_provisioned_nodes.yaml +++ b/templates/not_provisioned_nodes.yaml @@ -2,25 +2,25 @@ id: not_provisioned_nodes resources: #% for node in nodes %# #% set id = node.id | replace(':', '_') %# - - id: ssh_transport{{ id }} + - id: ssh_transport#{ id }# from: resources/transport_ssh values: ssh_user: 'root' ssh_key: '/vagrant/tmp/keys/ssh_private' - - id: transports{{id}} + - id: transports#{id}# from: resources/transports values: - transports:key: ssh_transport{{id}}::ssh_key - transports:user: ssh_transport{{id}}::ssh_user - transports:port: ssh_transport{{id}}::ssh_port - transports:name: ssh_transport{{id}}::name - - id: node_{{id}} + transports:key: ssh_transport#{id}#::ssh_key + transports:user: ssh_transport#{id}#::ssh_user + transports:port: ssh_transport#{id}#::ssh_port + transports:name: ssh_transport#{id}#::name + - id: node_#{id}# from: resources/not_provisioned_node values: - ip: {{node.ip}} - transports_id: transports{{id}}::transports_id - name: node_{{id}} - admin_mac: {{node.mac}} + ip: #{node.ip}# + transports_id: transports#{id}#::transports_id + name: node_#{id}# + admin_mac: #{node.mac}# #% endfor %# - id: ssh_transport_master diff --git a/templates/openstack_base.yaml b/templates/openstack_base.yaml index 62c19898..307d4cd3 100644 --- a/templates/openstack_base.yaml +++ b/templates/openstack_base.yaml @@ -5,12 +5,12 @@ resources: from: resources/keystone_tenant values: tenant_name: admin - keystone_port: '{{keystone_admin_port}}' - keystone_host: '{{keystone_ip}}' - admin_token: '{{admin_token}}' - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + keystone_port: '#{keystone_admin_port}#' + keystone_host: '#{keystone_ip}#' + admin_token: '#{admin_token}#' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: admin_user from: resources/keystone_user @@ -18,12 +18,12 @@ resources: user_name: 'admin' user_password: 'admin' tenant_name: 'admin_tenant::tenant_name' - keystone_port: '{{keystone_admin_port}}' - keystone_host: '{{keystone_ip}}' - admin_token: '{{admin_token}}' - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + keystone_port: '#{keystone_admin_port}#' + keystone_host: '#{keystone_ip}#' + admin_token: '#{admin_token}#' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: admin_role from: resources/keystone_role @@ -31,44 +31,44 @@ resources: role_name: 'admin' user_name: 'admin_user::user_name' tenant_name: 'admin_user::tenant_name' - keystone_port: '{{keystone_admin_port}}' - keystone_host: '{{keystone_ip}}' - admin_token: '{{admin_token}}' - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + keystone_port: '#{keystone_admin_port}#' + keystone_host: '#{keystone_ip}#' + admin_token: '#{admin_token}#' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: keystone_service_endpoint from: resources/keystone_service_endpoint values: #% raw %# - adminurl: 'http://{{admin_ip}}:{{admin_port}}/v2.0' - internalurl: 'http://{{internal_ip}}:{{internal_port}}/v2.0' - publicurl: 'http://{{public_ip}}:{{public_port}}/v2.0' + adminurl: 'http://#{admin_ip}#:#{admin_port}#/v2.0' + internalurl: 'http://#{internal_ip}#:#{internal_port}#/v2.0' + publicurl: 'http://#{public_ip}#:#{public_port}#/v2.0' #% endraw %# description: 'OpenStack Identity Service' type: 'identity' endpoint_name: 'keystone' - admin_port: '{{keystone_admin_port}}' - public_port: '{{keystone_port}}' - internal_port: '{{keystone_port}}' - admin_ip: '{{ip}}' - public_ip: '{{ip}}' - internal_ip: '{{ip}}' - keystone_admin_port: '{{keystone_admin_port}}' - keystone_host: '{{keystone_ip}}' - admin_token: '{{admin_token}}' - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + admin_port: '#{keystone_admin_port}#' + public_port: '#{keystone_port}#' + internal_port: '#{keystone_port}#' + admin_ip: '#{ip}#' + public_ip: '#{ip}#' + internal_ip: '#{ip}#' + keystone_admin_port: '#{keystone_admin_port}#' + keystone_host: '#{keystone_ip}#' + admin_token: '#{admin_token}#' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' - id: service_tenant from: resources/keystone_tenant values: tenant_name: services - keystone_port: '{{keystone_admin_port}}' - keystone_host: '{{keystone_ip}}' - admin_token: '{{admin_token}}' - ip: '{{ip}}' - ssh_user: '{{ssh_user}}' - ssh_key: '{{ssh_key}}' + keystone_port: '#{keystone_admin_port}#' + keystone_host: '#{keystone_ip}#' + admin_token: '#{admin_token}#' + ip: '#{ip}#' + ssh_user: '#{ssh_user}#' + ssh_key: '#{ssh_key}#' diff --git a/templates/profile.yaml b/templates/profile.yaml index 6e308364..956a6bd3 100644 --- a/templates/profile.yaml +++ b/templates/profile.yaml @@ -1,4 +1,4 @@ -id: {{id}} +id: #{id}# type: profile extensions: @@ -7,7 +7,7 @@ extensions: - id: ansible version: '1.0.0' -tags: {{tags}} +tags: #{tags}# connections: # keystone diff --git a/templates/sources.yaml b/templates/sources.yaml index a4f13e38..47ecb94e 100644 --- a/templates/sources.yaml +++ b/templates/sources.yaml @@ -1,8 +1,8 @@ id: sources resources: - - id: sources{{index}} + - id: sources#{index}# from: resources/sources - location: {{node}} + location: #{node}# values: sources: - {src: /tmp/sources_test, dst: /tmp/sources_test}