postgresql/tasks/main.yaml
changeset 93 976670b2ca63
parent 75 d8c87a41cc6d
equal deleted inserted replaced
92:d4924111ce28 93:976670b2ca63
       
     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"