automated terminal push
This commit is contained in:
1 parent
751acfe646
commit
0282e18140
10 files changed
+361
No files matched your search
@@ -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
|
||||
@@ -0,0 +1,2 @@
|
||||
[inventory_hosts]
|
||||
# overwritten dynamically by Jenkins with the EC2 public IP
|
||||
Reference in new issue
Block a user