tweak ansible uninstall

This commit is contained in:
t3chn0m4g3 2023-06-26 17:36:40 +02:00
parent 3c92e6ec06
commit df4ca7ccd0

View file

@ -46,7 +46,8 @@
groups: groups:
- docker - docker
- tpot - tpot
state: absent state: present
remove: yes
when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"] when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"]
- name: Check for non-root user id (All) - name: Check for non-root user id (All)
@ -65,16 +66,11 @@
become: true become: true
tasks: tasks:
- name: Remove T-Pot group (All)
group:
name: tpot
state: absent
when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"]
- name: Remove T-Pot user (All) - name: Remove T-Pot user (All)
user: user:
name: tpot name: tpot
state: absent state: absent
remove: yes
when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"] when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"]
- name: Revert SELinux config (Fedora) - name: Revert SELinux config (Fedora)
@ -161,7 +157,6 @@
- name: Stop all Docker containers (All) - name: Stop all Docker containers (All)
docker_container: docker_container:
state: absent state: absent
force: true
name: "*" name: "*"
when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"] when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"]
ignore_errors: true ignore_errors: true
@ -176,13 +171,6 @@
when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"] when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"]
ignore_errors: true ignore_errors: true
- name: Stop Docker
service:
name: docker
state: stopped
enabled: false
when: ansible_distribution in ["Debian", "Fedora", "openSUSE Tumbleweed", "Ubuntu"]
- name: Uninstall Docker Engine packages - name: Uninstall Docker Engine packages
package: package:
name: name:
@ -235,7 +223,6 @@
package: package:
name: name:
- busybox-net-tools - busybox-net-tools
- git
- grc - grc
- neovim - neovim
- net-tools - net-tools
@ -250,7 +237,6 @@
- net-tools - net-tools
- postfix - postfix
- yast2-auth-client - yast2-auth-client
- yast2-auth-user state: present
state: latest
update_cache: yes update_cache: yes
when: ansible_distribution == "openSUSE Tumbleweed" when: ansible_distribution == "openSUSE Tumbleweed"