小编Bat*_*oot的帖子

Ansible cloudformation模块

我不明白如何正确使用template_parameters参数(http://docs.ansible.com/ansible/cloudformation_module.html)

所以,看起来我可以使用这个参数覆盖模板中的一些参数.配置非常简单

sandbox_cloudformation.yml

---

- name: Sandbox CloudFormation
  hosts: localhost
  connection: local
  gather_facts: false

  tasks:

   - name: Launch Ansible CloudFormation Stack
     cloudformation:
       aws_access_key: "{{ aws_access_key }}"
       aws_secret_key: "{{ aws_secret_key }}"
       stack_name: "{{ aws_default_cloudformation_stack_name }}"
       state: "present"
       region: "{{ aws_default_region }}"
       disable_rollback: true
       template: "files/cloudformation.yml"
     args:
       template_parameters:
         GroupDescription: "Sandbox Security Group"
Run Code Online (Sandbox Code Playgroud)

cloudformation.yml

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Sandbox Stack
Resources:
  SandboxSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: "DEMO"
      SecurityGroupIngress:
      - IpProtocol: tcp
        FromPort: '80'
        ToPort: '80'
        CidrIp: 0.0.0.0/0
      - IpProtocol: tcp
        FromPort: …
Run Code Online (Sandbox Code Playgroud)

aws-cloudformation ansible

3
推荐指数
1
解决办法
1770
查看次数

标签 统计

ansible ×1

aws-cloudformation ×1