remove mysql

trying to remove mysql from a previous install

trying to remove mysql from a previous install

--
- hosts: all
become: true
vars_files:
- vars/default.yml

tasks:
- name: Uninstall MySQL packages.
apt: name={{ item }} state=absent
with_items:
- mysql-server
- mysql-client

but not working

To me it looks like it works (removing the packages), but your syntax is outdated.

It should be

   apt:
     name:
       - mysql-server
       - mysql-client

Regards
         Racke

this was the original install and I am just trying to reverse the installs

I tried this pb but its not uninstalling

I tried this pb but its not uninstalling

Can you be more specific? What version of Ansible are you using, what version of Debian/Ubuntu is the server you’re working on?

What is the output of this command when you run it on the machine you’re wanting to remove the packages from:

apt list | egrep ‘^mysql-server/|^mysql-client/|^python3-pymysql/|^php/|^libapache2-mod-php/’

Can you write a playbook with just the single task and run it with “-vvv” and paste the output in a response here?

The indenting in your previous example is slightly askew, and it is missing the “state: absent” parameter, but I’ll make the assumption that is just a copy-and-paste error.

    this was the original install and I am just trying to reverse the installs

What is the distribution and the release of the target server(s)?

Regards
          Racke

control server is ubuntu 19.10
client is 20.04

ok working now

are these 2 pb doing same thing?

The actions that those two tasks perform look to be the same, but you should update the “name:” field to better reflect that the job is removing/un-installing those packages.