{% if pillar.basics is defined %} include: {% if pillar.basics.firewall is defined %} - basics.firewall {% endif %} {% if pillar.basics.ssh is defined %} - basics.ssh {% endif %} {% endif %} Make sure all packages are up to date: pkg.uptodate: - refresh: True