--- - name: Update apt cache. apt: update_cache=yes cache_valid_time=86400 - name: Ensure common_node packages are installed. apt: "name={{ common_node_packages }} state=present" - name: Install linux headers when: inventory_hostname in groups['node_standalone'] block: - name: Install i386 linux headers Debian when: ansible_architecture == 'i386' and ansible_distribution == 'Debian' apt: name: ['linux-headers-686', 'linux-headers-686-pae'] - name: Install amd64 linux headers Debian when: ansible_architecture == 'x86_64' and ansible_distribution == 'Debian' apt: name: ['linux-headers-amd64'] - name: Install linux headers Ubuntu when: ansible_distribution == 'Ubuntu' apt: name: linux-headers-generic