automated terminal push
This commit is contained in:
39
ansible/configure_ecs.yml
Normal file
39
ansible/configure_ecs.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Configure EC2 for ECS Cluster
|
||||
hosts: inventory_hosts
|
||||
become: yes
|
||||
|
||||
vars:
|
||||
ecs_cluster_name: "nvhi-atsila-cluster"
|
||||
|
||||
tasks:
|
||||
- name: Install Docker
|
||||
apt:
|
||||
name: docker.io
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Start and enable Docker
|
||||
service:
|
||||
name: docker
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Write ECS config file
|
||||
copy:
|
||||
dest: /etc/ecs/ecs.config
|
||||
content: |
|
||||
ECS_CLUSTER={{ ecs_cluster_name }}
|
||||
|
||||
- name: Run ECS agent container
|
||||
docker_container:
|
||||
name: ecs-agent
|
||||
image: amazon/amazon-ecs-agent:latest
|
||||
state: started
|
||||
restart_policy: always
|
||||
env_file: /etc/ecs/ecs.config
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /var/log/ecs:/log
|
||||
- /var/lib/ecs/data:/data
|
||||
network_mode: host
|
2
ansible/hosts
Normal file
2
ansible/hosts
Normal file
@@ -0,0 +1,2 @@
|
||||
[inventory_hosts]
|
||||
# overwritten dynamically by Jenkins with the EC2 public IP
|
Reference in New Issue
Block a user