如何在mongo脚本中使用ansible剧本中的变量?

时间:2019-07-30 15:11:52

标签: mongodb jenkins ansible

我有一个剧本剧本

vars:
    cot_db_name: "test"
  user: "root"
  become: true
  roles:
    - setup_mongodb

我想在mongo脚本中使用'cot_db_name'的值,该脚本将使用此数据库并执行某些操作。

mongo_script的开头为:

use {{cot_db_name}}
// further code

剧本无法执行。有人可以帮我吗?

我也尝试过:use "{{cot_db_name}}"use "$${{cot_db_name}}"

0 个答案:

没有答案