postgresql/tasks/main.yaml
changeset 40 b42b417751e5
child 227 2e0366f2dcbe
equal deleted inserted replaced
39:90b1b7c4be70 40:b42b417751e5
       
     1 ---
       
     2 
       
     3 - name: install postgresql
       
     4   become: yes
       
     5   apt: name="{{postgresql_apt_packages}}"
       
     6 
       
     7 - name: configure postgresql data dir
       
     8   become: yes
       
     9   lineinfile:
       
    10     path: "{{postgresql_config_path}}"
       
    11     regexp: "^data_directory = "
       
    12     line: "data_directory = '{{postgresql_data_dir}}'"
       
    13   notify: restart postgres
       
    14 
       
    15 - name: create postgresql data dir
       
    16   become: yes
       
    17   file:
       
    18     path: "{{postgresql_data_dir}}"
       
    19     state: "directory"
       
    20     mode: "0700"
       
    21     owner: "postgres"
       
    22     group: "postgres"
       
    23   notify: restart postgres
       
    24 
       
    25 - name: ensure postgresql is started
       
    26   become: yes
       
    27   systemd: name="postgresql" enabled="yes" state="started"