Update playbook Ansible

This commit is contained in:
d3m0k1d
2025-10-17 21:13:36 +03:00
parent 5be03f8bd9
commit c85747da23

View File

@@ -3,29 +3,40 @@
become: yes become: yes
tasks: tasks:
- name: install git - name: Install git
apt: apt:
name: git name: git
state: latest state: latest
update_cache: yes
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
- name: clone repo with script - name: Clone repo with script
ansible.builtin.git: ansible.builtin.git:
clone: https://github.com/d3m0k1d/automation-scripts.git repo: https://github.com/d3m0k1d/automation-scripts.git
dest: /opt/automation-scripts
version: main
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
- name: run install script - name: Make install script executable
ansible.builtin.shell: ansible.builtin.file:
path: /automation-scripts/scripts/sysadmins/debian-init-docker.sh path: /opt/automation-scripts/scripts/sysadmins/debian-init-docker.sh
mode: '0755'
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
- name: Run install script
ansible.builtin.shell:
cmd: /opt/automation-scripts/scripts/sysadmins/debian-init-docker.sh
chdir: /opt/automation-scripts/scripts/sysadmins
when: ansible_os_family == "Debian"
register: docker_install_result
- name: Install certbot - name: Install certbot
apt: apt:
name: python3-certbot-nginix name: python3-certbot-nginx
state: latest state: latest
update_cache: yes
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
- name: Run certbot - name: Run certbot for domain
shell: shell: certbot --nginx -d your-domain.com -d www.your-domain.com --non-interactive --agree-tos --email your-email@example.com
when: ansible_os_family == "Debian"