--- - name: install base rpms yum: pkg={{ item }} state=installed with_items: - screen - htop - iftop - iotop - strace - vim-enhanced - tcpdump - chrony - yum-cron - service: name={{ item }} state=running enabled=yes with_items: - yum-cron - chronyd - copy: dest=/etc/cloud/cloud.cfg.d/06_preserve_hostname.cfg src=06_preserve_hostname.cfg - name: install firewalld on centos7 yum: pkg=firewalld state=installed when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7' - service: name=firewalld state=started enabled=yes when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7'