Outils pour utilisateurs

Outils du site


tech:ansible_aws_-_cloud

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
tech:ansible_aws_-_cloud [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:ansible_aws_-_cloud [2026/06/16 15:18] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon}}
 +
 +# Ansible AWS - Cloud
 +
 +Voir : [Pourquoi ansible n’est pas un bon choix pour créer son infra AWS](https://blog.xebia.fr/2017/03/14/pourquoi-ansible-nest-pas-un-bon-choix-pour-creer-son-infra-aws/)
 +
 +`~/.boto`
 +~~~ini
 +[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`
 +~~~ini
 +[default]
 +aws_access_key_id = 01234ABC
 +aws_secret_access_key = 01234ABC
 +~~~
 +
 +`~/.aws/config`
 +~~~ini
 +[default]
 +#region = us-west-2
 +region = us-east-2
 +output = table
 +~~~
 +
 +
 +`pb.yml`
 +~~~yaml
 +#! /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`
 +~~~yaml
 +---
 +
 +- 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
 +  
 +~~~  
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki