| 1 | --- |
| 2 | - name: Update apt cache. |
| 3 | apt: update_cache=yes cache_valid_time=86400 |
| 4 | |
| 5 | - name: Ensure common_node packages are installed. |
| 6 | apt: "name={{ common_node_packages }} state=present" |
| 7 | |
| 8 | - name: Install linux headers |
| 9 | when: ansible_virtualization_role == "host" or (ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm") |
| 10 | block: |
| 11 | - name: Install i386 linux headers Debian |
| 12 | when: ansible_architecture == 'i386' and ansible_distribution == 'Debian' |
| 13 | apt: |
| 14 | name: ['linux-headers-686', 'linux-headers-686-pae'] |
| 15 | - name: Install amd64 linux headers Debian |
| 16 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Debian' |
| 17 | apt: |
| 18 | name: ['linux-headers-amd64'] |
| 19 | - name: Install armhf linux headers Debian |
| 20 | when: ansible_architecture == 'armv7l' and ansible_distribution == 'Debian' |
| 21 | apt: |
| 22 | name: ['linux-headers-armmp-lpae'] |
| 23 | - name: Install arm64 linux headers Debian |
| 24 | when: ansible_architecture == 'aarch64' and ansible_distribution == 'Debian' |
| 25 | apt: |
| 26 | name: ['linux-headers-arm64'] |
| 27 | - name: Install linux headers Ubuntu |
| 28 | when: ansible_distribution == 'Ubuntu' |
| 29 | apt: |
| 30 | name: linux-headers-generic |