Files
pet-project-server/playbook-remove-user-and-app.yml
Anton Vakhrushev 8728eb0203
Some checks failed
Linting / YAML Lint (push) Successful in 9s
Linting / Ansible Lint (push) Failing after 29s
Improve docs
2026-01-18 10:02:44 +03:00

37 lines
806 B
YAML

---
- name: "Update and upgrade system packages"
hosts: all
vars_files:
- vars/secrets.yml
vars:
user_name: "<put-name-here>"
tasks:
- name: 'Remove user "{{ user_name }}"'
ansible.builtin.user:
name: "{{ user_name }}"
state: absent
remove: true
- name: 'Remove group "{{ user_name }}"'
ansible.builtin.group:
name: "{{ user_name }}"
state: absent
- name: "Remove web dir"
ansible.builtin.file:
path: "/var/www/{{ user_name }}"
state: absent
- name: "Remove application dir"
ansible.builtin.file:
path: "/mnt/applications/{{ user_name }}"
state: absent
- name: "Remove home dir"
ansible.builtin.file:
path: "/home/{{ user_name }}"
state: absent