> 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. 
On Wednesday, July 15, 2020 at 12:21:47 PM UTC-5 tdub...@gmail.com wrote:

> I tried this pb but its not uninstalling
>
>
> --
> - hosts: all
>   become: true
>   vars_files:
>     - vars/default.yml
>
>   tasks:
>     - name: remove
>
>       apt:
>        name:
>         - mysql-server
>         - mysql-client
>         - python3-pymysql
>         - php
>         - php-mysql
>         - libapache2-mod-php
>
> On Wed, Jul 15, 2020 at 9:55 AM Tony Wong <tdub...@gmail.com> wrote:
>
>> this was the original install and I am just trying to reverse the installs
>>>
>>
>> ---
>> - hosts: all
>>   become: true
>>   vars_files:
>>     - vars/default.yml
>> tasks:
>>     - name: Install prerequisites
>>       apt: name={{ item }} update_cache=yes state=absent force_apt_get=yes
>>       loop: [ 'aptitude' ]
>>
>>   #Apache Configuration
>>     - name: Install LAMP Packages
>>       apt: name={{ item }} update_cache=yes state=absent
>>       loop: [ 'apache2', 'mysql-server', 'python3-pymysql', 'php', 
>> 'php-mysql', 'libapache2-mod-php' ]
>>
>>     - name: Create document root
>>       file:
>>         path: "/var/www/{{ http_host }}"
>>         state: directory
>>         owner: "{{ app_user }}"
>>         mode: '0755'
>>
>>     - name: Set up Apache virtualhost
>>       template:
>>         src: "files/apache.conf.j2"
>>         dest: "/etc/apache2/sites-available/{{ http_conf }}"
>>       notify: Reload Apache
>>
>>     - name: Enable new site
>>       shell: /usr/sbin/a2ensite {{ http_conf }}
>>       notify: Reload Apache
>>
>>     - name: Disable default Apache site
>>       shell: /usr/sbin/a2dissite 000-default.conf
>>       when: disable_default
>>       notify: Reload Apache
>>
>>   # MySQL Configuration
>>     - name: Sets the root password
>>       mysql_user:
>>         name: root
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/22025670-024c-4721-a6c5-d2103962f99dn%40googlegroups.com.

Reply via email to