Ansible | eittech_
Ansible
Aprovisionamiento de Servidor con Ansible

Instalar Anssibel en maquina local

Linux
sudo apt-get install ansible

MacOS
brew install ansible

CREAR EL ARCHOVO HOST

sudo nano host

[web]
IP DEl SERVIDOR

[web:vars]
ansible_user=ec2-user
ansible_ssh_private_key_file=~/.ssh/clave-ssh

sudo nano ansible.yaml

---
- name: Instala Docker e Inicia el Servicio
hosts: AWS
become: yes
vars:
ansible_user: ec2-user
ansible_ssh_private_key_file: ~/.ssh/eittech
remote_user: root
tasks:

- name: instala docker y modulos necesarios
yum:
pkg: ['docker']
# pkg: ['docker','python3-pip']
state: latest
update_cache: yes

- name: inicia servicio docker
service: name=docker state=started

PROBAR CONEXION

ansible eittech-s0 -m ping
ssh-key
Comandos para configurar servidores con claves ssh