Переписал всё, сейчас вроде как отрабатывает без ошибок

This commit is contained in:
B4D_US3R 2025-08-02 09:57:37 +05:00
parent 436adfbc4f
commit 26f2ea374d
49 changed files with 1404 additions and 169 deletions

View file

@ -0,0 +1,10 @@
- name: Copy temp Nginx config
ansible.builtin.template:
src: pleroma.nginx.j2
dest: /etc/nginx/sites-enabled/pleroma.conf
mode: '0644'
- name: Reload Nginx
ansible.builtin.service:
name: nginx
state: reloaded

View file

@ -0,0 +1,59 @@
- name: Copy SystemD service
ansible.builtin.copy:
remote_src: true
src: /opt/pleroma/installation/pleroma.service
dest: /etc/systemd/system/pleroma.service
mode: '0644'
- name: Start Pleroma service
ansible.builtin.systemd_service:
daemon_reload: true
name: pleroma
enabled: true
state: started
- name: Check Pleroma work
ansible.builtin.uri:
url: http://localhost:4000/api/pleroma/healthcheck
method: GET
register: result
until: result.status != -1
retries: 5
delay: 20
- name: Get admin username
ansible.builtin.pause:
prompt: Input admin username
register: result
- name: Set admin username
ansible.builtin.set_fact:
pleroma_postinstall_admin: "{{ result.user_input }}"
- name: Get admin email
ansible.builtin.pause:
prompt: Input admin email
register: result
- name: Set admin email
ansible.builtin.set_fact:
pleroma_postinstall_admin_email: "{{ result.user_input }}"
- name: Generate admin password
ansible.builtin.set_fact:
pleroma_postinstall_admin_password: "{{ lookup('community.general.random_string', length=12, special=false) }}"
- name: Create user
become: true
become_user: pleroma
environment:
- MIX_ENV: prod
ansible.builtin.shell:
chdir: /opt/pleroma
cmd: |
mix pleroma.user new {{ pleroma_postinstall_admin }} {{ pleroma_postinstall_admin_email }} --password {{ pleroma_postinstall_admin_password }} -y --admin
- name: Check Debian
when: ansible_facts["distribution"] == "Debian"
ansible.builtin.include_tasks:
file: debian.yml

View file

@ -0,0 +1,16 @@
server {
server_name {{ pleroma_building_domain }};
listen 80;
listen [::]:80;
# Uncomment this if you need to use the 'webroot' method with certbot. Make sure
# that the directory exists and that it is accessible by the webserver. If you followed
# the guide, you already ran 'mkdir -p /var/lib/letsencrypt' to create the folder.
# You may need to load this file with the ssl server block commented out, run certbot
# to get the certificate, and then uncomment it.
#
location ~ /\.well-known/acme-challenge {
root /var/lib/letsencrypt/;
}
}