automated terminal push

This commit is contained in:
lenape
2025-07-12 18:36:46 +00:00
parent 40b0504f57
commit ef7c7c7ca3
3 changed files with 28 additions and 25 deletions

View File

@@ -7,11 +7,20 @@
ecs_cluster_name: "nvhi-atsila-cluster"
tasks:
- name: Update all packages
yum:
name: '*'
state: latest
- name: Install Docker
apt:
name: docker.io
yum:
name: docker
state: present
- name: Install ECS init
yum:
name: ecs-init
state: present
update_cache: yes
- name: Start and enable Docker
service:
@@ -19,21 +28,22 @@
state: started
enabled: true
- name: Create ECS config directory
file:
path: /etc/ecs
state: directory
mode: '0755'
- name: Write ECS config file
copy:
dest: /etc/ecs/ecs.config
content: |
ECS_CLUSTER={{ ecs_cluster_name }}
ECS_AVAILABLE_LOGGING_DRIVERS=["json-file","awslogs"]
mode: '0644'
- name: Run ECS agent container
docker_container:
name: ecs-agent
image: amazon/amazon-ecs-agent:latest
- name: Start and enable ECS agent
service:
name: ecs
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
enabled: true