Ansible AWS - Cloud

Voir : Pourquoi ansible n’est pas un bon choix pour créer son infra AWS

~/.boto

[Credentials] aws_access_key_id = 01234ABC aws_secret_access_key = 01234ABC [Boto] debug = 0 proxy = 192.168.56.1 proxy_port = 3128 #ec2_region_name = us-east-2 #ec2_region_endpoint = ec2.us-east-2.amazonaws.com

~/.aws/credentials

[default] aws_access_key_id = 01234ABC aws_secret_access_key = 01234ABC

~/.aws/config

[default] #region = us-west-2 region = us-east-2 output = table

pb.yml

#! /usr/bin/env ansible-playbook --- - name: Configure new server hosts: localhost vars: ansible_python_interpreter: /usr/bin/python3 roles: - aws

roles/aws/tasks/main.yml

--- - ec2_instance: name: "test-ansible" key_name: "jean@vmdeb1" #vpc_subnet_id: subnet-5ca1ab1e instance_type: t2.micro #security_group: default security_group: 'sg-018f964b5b82d2361' network: assign_public_ip: true image_id: ami-05829248ffee66250 register: new_ec2_instance - name: DEBUG debug: var=new_ec2_instance.instances[0].network_interfaces[0].association.public_ip