43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
- name: Configure a frontend server
|
|
hosts: server
|
|
become: yes
|
|
|
|
tasks:
|
|
- name: Install git
|
|
apt:
|
|
name: git
|
|
state: latest
|
|
update_cache: yes
|
|
when: ansible_os_family == "Debian"
|
|
|
|
- name: Clone repo with script
|
|
ansible.builtin.git:
|
|
repo: https://github.com/d3m0k1d/automation-scripts.git
|
|
dest: /opt/automation-scripts
|
|
version: main
|
|
when: ansible_os_family == "Debian"
|
|
|
|
- name: Make install script executable
|
|
ansible.builtin.file:
|
|
path: /opt/automation-scripts/scripts/sysadmins/debian-init-docker.sh
|
|
mode: '0755'
|
|
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
|
|
apt:
|
|
name: python3-certbot-nginx
|
|
state: latest
|
|
update_cache: yes
|
|
when: ansible_os_family == "Debian"
|
|
|
|
- name: Run certbot for domain
|
|
shell: certbot --nginx -d d3m0k1d.ru -d www.d3m0k1d.ru --non-interactive --agree-tos --email contact@d3m0k1d.ru
|
|
when: ansible_os_family == "Debian"
|