- name: Start firewalld
  systemd:
    name: firewalld
    enabled: yes
    state: started
  become: true

- name: Add firewalld http and https service
  firewalld:
    service: "{{ item }}"
    permanent: true
    state: enabled
    zone: public
    immediate: true
  with_items:
    - http
    - https
  become: true

- name: Install firewalld
  yum:
    name: firewalld
    state: present

- name: Start firewalld
  systemd:
    name: firewalld
    enabled: yes
    state: started
  become: true

- name: Add firewalld http and https service
  firewalld:
    service: "{{ item }}"
    permanent: true
    state: enabled
    zone: public
    immediate: true
  with_items:
    - http
    - https
  become: true

Install firewalld before starting it
Install firewalld before starting it

Firewalld was installed on vagrant centos by default but not on server.
