我想用Ansible部署一些配置文件:
<div class="form-group">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-5 col-xxs">
<label class="control-label">Confirm Email Address</label>
</div>
<div class="col-lg-4 col-md-4 col-sm-5 col-xs-7 col-xxs">
<input placeholder="Email address." class="form-control" type="text" name="re_email" value="<?php echo input_data('re_email'); ?>">
<?php echo form_error('re_email'); ?>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="
col-lg-offset-3 col-md-offset-3 col-sm-offset-4
col-lg-9 col-md-9 col-sm-8
">
<input type="submit" class="btn btn-sm btn-primary" value="Submit">
</div>
</div>
</div>
文件包含以下行:
- name: Deploying test configuration
template: src={{ item }}.j2 dest={{ basho_bench_home_dir }}/conf/{{ item }}
sudo: yes
with_items:
- http_fix_1min.conf.template
- http_max_1min.conf
这最终打破了J2渲染:
{mode, max}.
{duration, 1}.
{concurrent, 32}.
我不知道如何告诉J2将模板作为一个巨大的字符串来处理。我试过{{&#39; &#39;}}正如文档所示。它现在确实有效。