--- - name: Install postgres apt: name: "{{ postgres_packages }}" state: present become: true register: postgres_install - name: Start and enable the service systemd: name: postgresql state: started enabled: true become: true