--- - name: Install additional software packages package: name: "{{ item }}" state: present become: true with_items: "{{ install_packages }}" - name: Remove specified software packages package: name: "{{ item }}" state: absent become: true with_items: "{{ remove_packages }}"