我试图了解如何使用保险库加密单个变量.首先我用字符串加密字符串ansible-vault encrypt_string -n -p,然后将输出写入我的剧本.当我执行playbook时,它说解密的字符串不是JSON可序列化的.
加密的字符串:"inline_name"
我也尝试过inline_name和inlinename,具有相同的结果每次.
我的剧本:
---
- name: Build System
hosts: dev
tasks:
- name: Create
mysql_db:
state: present
name: !vault |
$ANSIBLE_VAULT;1.1;AES256
39613261386438623937643062636166663638633062323939343734306334346537613233623064
3761633832326365356231633338396132646532313861350a316666376566616633376238313636
39343833306462323534623238333639663734626662623731666239366566643636386261643164
3861363730336331660a316165633232323732633364346636363764623639356562336536636136
6364
login_host: "{{ mysql_host }}"
login_user: "{{ mysql_user }}"
login_password: "{{ mysql_pass }}"
- name: Check if can access plain text vars
debug:
msg: "{{ my_plain_txt }}"
Run Code Online (Sandbox Code Playgroud)
错误信息:
An exception occurred during task execution. To see the full traceback, use -vvv.
The error was: …Run Code Online (Sandbox Code Playgroud) 我的用例:
我有一个使用ui-router的多步骤表单,如下面的plunkr.我使用ng-form来验证AngularJS提供的信息,比如$ valid,$ dirty等.
每次单击"下一部分"按钮后,我将表单数据发送到服务器以便检索它,以防用户在完成之前退出表单.
如果用户提交两次第一步,我只发送编辑过的数据(如果$ dirty值为true).所有这些都不在plunkr中,我选择向您展示一个简单的表单,但我的表单可以包含一百个字段(收音机,复选框,输入,选择等).
重现问题的步骤(plunkr):
myMultiStepForm.interests.xbox.$dirty = truemyMultiStepForm.interests.xbox.$dirty = false为什么$ dirty值变为false?我想这是因为<ng-form>再次显示并重置所有验证数据.
有办法避免这种情况吗?或者除了<ng-form>处理字段子集的验证之外的其他东西?
这是plunkr:http://plnkr.co/edit/WclqVgiBvUXlsGdSCcj0?p = preview
我正在尝试实现一个角色,该角色在继续执行剧本的其余部分之前检查给定目录是否为空。
我已经尝试过这段代码,但出现错误,我不确定正确的实现。
- name: Check if d folder is empty before proceeding
find:
paths: c/d/
patterns: "*.*"
register: filesFound
- fail:
msg: The d folder is not empty.
when: filesFound.matched > 0
- debug:
msg: "The d folder is empty. Proceeding."
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
fatal FAILED! =>
{"changed": false,
"module_stderr": "Exception calling \"Create\" with \"1\" argument(s):
\"At line:4 char:21
def _ansiballz_main():
An expression was expected after '('.
At line:12 char:27
except (AttributeError, OSError):
Missing argument in parameter list.
At line:14 char:7
if …Run Code Online (Sandbox Code Playgroud) 如何在 NetBeans IDE 8.1 中添加 Fira 代码:带有编程连字的等宽字体?
我四处寻找,我发现的只是它是可能的并且它有效,但不是如何。
我已经设法改变了字体,但连字不起作用。