refactor(ansible): разложить репозиторий по схеме Ansible
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a23232ac1c
commit
27f15e7bc7
23 files changed
+277
-242
No files matched your search
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Подготовить Python для Ansible
|
||||
ansible.builtin.raw: DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-apt
|
||||
changed_when: false
|
||||
|
||||
- name: Собрать факты
|
||||
ansible.builtin.setup:
|
||||
|
||||
- name: Поставить Docker
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- docker.io
|
||||
- docker-compose-v2
|
||||
- ufw
|
||||
- ca-certificates
|
||||
- curl
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Включить Docker
|
||||
ansible.builtin.systemd:
|
||||
name: docker
|
||||
enabled: true
|
||||
state: started
|
||||
|
||||
- name: Разрешить SSH
|
||||
ansible.builtin.command: ufw allow OpenSSH
|
||||
register: ufw_ssh
|
||||
changed_when: "'added' in (ufw_ssh.stdout | lower)"
|
||||
|
||||
- name: Проверить состояние firewall
|
||||
ansible.builtin.command: ufw status
|
||||
register: ufw_status
|
||||
changed_when: false
|
||||
|
||||
- name: Включить firewall
|
||||
ansible.builtin.command: ufw --force enable
|
||||
when: "'Status: active' not in ufw_status.stdout"
|
||||
changed_when: true
|
||||
Reference in new issue
Block a user