我有一个Ansible Playbook,可以调用另一个传递参数的playbook.这很好,但是当我尝试传入变量时,Ansible会爆炸.这是我的剧本:
---
- name: This is the toplevel play for orchestration
hosts: nogroup
vars:
customer: myCustomer
sudo: yes
- include: amazon.yml application=FooServer instance_type=t2.micro instance_count=1 customer={{ customer }}
- include: amazon.yml application=BarServer instance_type=t2.micro instance_count=1 customer={{ customer }}
Run Code Online (Sandbox Code Playgroud)
我试着跑:
ansible-playbook orchestration.yml -e "customer=otherCustomer"
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
Traceback (most recent call last):
File "/usr/local/Cellar/ansible/1.7.2/libexec/bin/ansible-playbook", line 5, in <module>
pkg_resources.run_script('ansible==1.7.2', 'ansible-playbook')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 492, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1350, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/Cellar/ansible/1.7.2/lib/python2.7/site-packages/ansible-1.7.2-py2.7.egg/EGG-INFO/scripts/ansible-playbook", line 309, in <module>
sys.exit(main(sys.argv[1:])) …Run Code Online (Sandbox Code Playgroud) 我正在写一个Alexa技能,我只能在我的代码中获得单字参数.
这是intent模式:
{
"intents": [
{
"intent": "HeroQuizIntent",
"slots": [
{
"name": "SearchTerm",
"type": "SEARCH_TERMS"
}
]
},
{
"intent": "HeroAnswerIntent",
"slots": [
{
"name": "SearchTerm",
"type": "SEARCH_TERMS"
}
]
},
{
"intent": "AMAZON.HelpIntent"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我的样本话语是:
HeroQuizIntent quiz me
HeroAnswerIntent is it {SearchTerm}
Run Code Online (Sandbox Code Playgroud)
对于HeroAnswerIntent,我正在检查SearchTerm插槽,我只会在那里找到单个单词.
因此,"彼得帕克"给出"帕克","史蒂夫罗杰斯"给出"罗杰斯","托尼斯塔克"给出"斯塔克".
如何在插槽中接受多个单词?
我在Slack中创建了一个自定义斜杠命令.后端代码,而不是它的重要性,是AWS中的Python中的Lambda函数.
我的问题是,当我输入斜杠命令时,我是唯一可以看到该消息的人.否则,它完美地运作.有没有办法让别人看到我的自定义斜杠命令的输出?
我正在尝试使用以下yaml在CloudFormation中创建S3 Bucket策略:
cloudTrailBucketPolicy:
Type: "AWS::S3::BucketPolicy"
Properties:
Bucket:
Ref: cloudtrailBucket
PolicyDocument:
-
Action:
- "s3:GetBucketAcl"
Effect: Allow
Resource:
Fn::Join:
- ""
-
- "arn:aws:s3:::"
-
Ref: cloudtrailBucket
- "/*"
Principal: "*"
-
Action:
- "s3:PutObject"
Effect: Allow
Resource:
Fn::Join:
- ""
-
- "arn:aws:s3:::"
-
Ref: cloudtrailBucket
- "/*"
Principal:
Service: cloudtrail.amazonaws.com
Run Code Online (Sandbox Code Playgroud)
当我尝试这样做时,我收到一条消息"属性PolicyDocument的值必须是一个对象"
有人有主意吗?