Ansible

Automation using Ansible

AWS credentials ( $random_gen)

Pending


export AWS_ACCESS_KEY_ID='add-aws-access-key-id'
export AWS_SECRET_ACCESS_KEY='add-aws-secret-access-key'
  • We are going to start with community.aws.cloudformation Ansible module.

boto, boto3, and botocore Python libraries:

pip3 install boto boto3 botocore

Ansible Playbook

---
- name: create cloudformation stack
  hosts: localhost
  gather_facts: False
  tasks:
    - name: launch cloudformation stack
      community.aws.cloudformation:
         stack_name: "stefano"
         state: "present"
         region: "us-east-2"
         template: "{{ lookup('file', '/Users/stefano/Downloads/DevOPS/code') }}"

To do:

Integrate into larger playbook

Last updated

Was this helpful?