Files
pet-project-server/playbook-remove-user-and-app.yml
Anton Vakhrushev 0a75378bbc
Some checks failed
Linting / YAML Lint (push) Failing after 9s
Linting / Ansible Lint (push) Successful in 16s
Remove old ports config
2025-12-14 19:25:33 +03:00

32 lines
668 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 home dir"
ansible.builtin.file:
path: "/home/{{ user_name }}"
state: absent