---
# Scaleway doesn't install aptitude on its images
# So check if aptitude is installed else install it
- name: update apt cache
  apt:
    update_cache: yes
    cache_valid_time: 3600
  changed_when: no
- name: install apt common dependencies
  apt:
    name: "{{item}}"
  with_items:
    - acl  # required by Ansible 2.1 to become_user
    - aptitude  # safe-upgrade dependency
    - ntp
    - python-pip
    - sudo
    - tmux
    - vim
- name: perform safe upgrade
  apt:
    upgrade: safe

# Timezone
- name: set timezone to Europe/Paris
  timezone:
    name: Europe/Paris

# Locale
- name: generate locale
  locale_gen:
    name: en_US.UTF-8
    state: present
- name: set locale
  copy:
    content: "LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8"
    dest: "/etc/default/locale"
    owner: root
    group: root
    mode: 0644

# Hostname
- name: set hostname
  hostname:
    name: "{{inventory_hostname.replace('.', '-')}}"
...

---
# Scaleway doesn't install aptitude on its images
# So check if aptitude is installed else install it
- name: update apt cache
  apt:
    update_cache: yes
    cache_valid_time: 3600
  changed_when: no
- name: install apt common dependencies
  apt:
    name: "{{item}}"
  with_items:
    - acl  # required by Ansible 2.1 to become_user
    - aptitude  # safe-upgrade dependency
    - ntp
    - python-pip
    - sudo
    - tmux
    - vim

# Timezone
- name: set timezone to Europe/Paris
  timezone:
    name: Europe/Paris

# Locale
- name: generate locale
  locale_gen:
    name: en_US.UTF-8
    state: present
- name: set locale
  copy:
    content: "LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8"
    dest: "/etc/default/locale"
    owner: root
    group: root
    mode: 0644

# Hostname
- name: set hostname
  hostname:
    name: "{{inventory_hostname.replace('.', '-')}}"
...

Remove safe upgrade from common role
Remove safe upgrade from common role
