---
- name: Include packages
  include_vars:
    file: "{{ item }}.yml"
  with_items:
    - packages
    - repositories

#Command for switch from apache2_handler to php-fpm
#- name: Remove a repo
#  apt_repository:
#    repo: "{{ item }}"
#    state: present
#    update_cache: no
#  with_items: removerepository

- name: Reinstall certificates
  apt:
    name: ca-certificates
    state: latest

# Add an apt key for the ppas by id from a keyserver
- name: Add ppa repository keys
  apt_key: keyserver=keyserver.ubuntu.com id=14AA40EC0831756756D7F66C4F4EA0AAE5267A6C
  become: Yes

- name: Ensure all necessary reposirories are present
  apt_repository:
    repo: "{{ item }}"
    state: present
  with_items: "{{ repositories }}"
  become: Yes

- name: perform apt-get update
  apt:
    update_cache: yes
    cache_valid_time: 360
  become: Yes

- name: ensure that packages are installed
  apt:
    name: "{{ item }}"
    state: present
  with_items: "{{ packages  }}"
  become: Yes

#- name: install php-fpm packages
#  apt:
#    name: "{{ item }}"
#    state: present
#  with_items: packagesfastcgi


---
- name: Include packages
  include_vars:
    file: "{{ item }}.yml"
  with_items:
    - packages
    - repositories

#Command for switch from apache2_handler to php-fpm
#- name: Remove a repo
#  apt_repository:
#    repo: "{{ item }}"
#    state: present
#    update_cache: no
#  with_items: removerepository

- name: Reinstall certificates
  apt:
    name: ca-certificates
    state: latest
  tags:
    # ansible-lint complains about state: latest and we do want this.
    - skip_ansible_lint

# Add an apt key for the ppas by id from a keyserver
- name: Add ppa repository keys
  apt_key: keyserver=keyserver.ubuntu.com id=14AA40EC0831756756D7F66C4F4EA0AAE5267A6C
  become: Yes

- name: Ensure all necessary reposirories are present
  apt_repository:
    repo: "{{ item }}"
    state: present
  with_items: "{{ repositories }}"
  become: Yes

- name: Perform apt-get update
  apt:
    update_cache: yes
    cache_valid_time: 360
  become: Yes

- name: Ensure that packages are installed
  apt:
    name: "{{ item }}"
    state: present
  with_items: "{{ packages  }}"
  become: Yes

#- name: install php-fpm packages
#  apt:
#    name: "{{ item }}"
#    state: present
#  with_items: packagesfastcgi


Make ansible-lint quiet on a particular role
Make ansible-lint quiet on a particular role
