我有一个蓝绿色的部署手册。它依赖于某些变量来确定应用基础角色的主机。以下是一个示例角色之一:
- name: Remove current server from load balancer
hosts: 'tag_Name_{{server_name}}_production'
remote_user: ec2-user
sudo: true
roles:
- remove-load-balancer
我可以使用指定的限制和标签调用此剧本,它可以很好地工作 - 但仅适用于一种类型的服务器。例如,此命令将以蓝绿色部署我们的服务服务器:
ansible-playbook blue.green.yml -i ec2.py -l tag_Name_services_production,tag_Name_services_production_old --skip-tags=restart,stop -e server_name=services -e core_repo=~/core
我想写一个主蓝绿色的剧本,它主要运行几个剧本 - 首先是api服务器,然后是服务服务器。我尝试使用包含但似乎无法正确使用语法 - ansible或者抱怨我的任务没有做任何事情或者抱怨语法错误:
- name: Blue green deploy to all production boxes.
hosts: localhost
tasks:
- include: blue.green.single.yml
hosts:
- tag_Name_api_production
- tag_Name_api_production_old
vars:
- server_name: api
skip-tags:
- restart
- stop
- include: blue.green.single.yml
hosts:
- tag_Name_services_production
- tag_Name_services_production_old
vars:
- server_name: services
skip-tags:
- restart
- stop
理想情况下,我可以这样称呼它:
ansible-playbook blue.green.yml -i ec2.py -e core_repo=~/core
有没有人成功完成这项工作?如果是这样 - 我怎么能做到这一点?
答案 0 :(得分:1)
这适合您的情况吗?
let url = NSURL (string: "http://someWebsite")
let requestObj = NSURLRequest(URL: url!);
webView.loadRequest(requestObj)