deploy_inital_postgresql.yml 2.41 KB
---
- hosts: deploy-wdchat-postgresql-302
  become: true
  tasks:
    - name: Create Database WDCHAT & WDAUTHEN & USER
      expect:
        command: /opt/stack/postgres/postgresql/bin/psql --host=127.0.0.1 --port=7432 --username=postgres -f /tmp/configuration/0_Create.User.sql
        responses:
            'Password for user postgres': 'password'
    
    - name: Create WDCHAT Table
      expect:
        command: /opt/stack/postgres/postgresql/bin/psql --host=127.0.0.1 --port=7432 --username=wdchat -d WDCHAT -f /tmp/configuration/1_Create.WDCHAT.Table.sql
        responses:
            'Password for user wdchat': 'BBRyAPNh6g4H9qte'
            
    - name: Initial WDCHAT
      expect: 
        command: /opt/stack/postgres/postgresql/bin/psql --host=127.0.0.1 --port=7432 --username=wdchat -d WDCHAT -f /tmp/configuration/2_Initial.WDCHAT.sql
        responses:
            'Password for user wdchat': 'BBRyAPNh6g4H9qte'
            
    - name: Create WDAUTHEN Table 
      expect:
        command: /opt/stack/postgres/postgresql/bin/psql --host=127.0.0.1 --port=7432 --username=wdauthen -d WDAUTHEN -f /tmp/configuration/3_Create.WDAUTHEN.Table.sql
        responses:
            'Password for user wdauthen': 'BBEcLWu5Cdzy3aeH'
            
    - name: Initial WDAUTHEN 
      expect:
        command: /opt/stack/postgres/postgresql/bin/psql --host=127.0.0.1 --port=7432 --username=wdauthen -d WDAUTHEN -f /tmp/configuration/4_Initial.WDAUTHEN.sql
        responses:
            'Password for user wdauthen': 'BBEcLWu5Cdzy3aeH'

- hosts: deploy-dma-postgresql-302, deploy-dma-postgresql-312
  become: true
  tasks:
    - name: Create Database WDCHAT
      expect:
        command: /opt/stack/postgres/postgresql/bin/psql --host=127.0.0.1 --port=7432 --username=postgres -f /tmp/configuration/0_Create.User.sql
        responses:
            'Password for user postgres': 'password'
    
    - name: Create DMA Table
      expect:
        command: /opt/stack/postgres/postgresql/bin/psql --host=127.0.0.1 --port=7432 --username=wdchat -d WDCHAT -f /tmp/configuration/Create.DMA.Table.sql
        responses:
            'Password for user wdchat': 'BBRyAPNh6g4H9qte'
            
    - name: Initial WDCHAT
      expect: 
        command: /opt/stack/postgres/postgresql/bin/psql --host=127.0.0.1 --port=7432 --username=wdchat -d WDCHAT -f /tmp/configuration/2_Initial.WDCHAT.sql
        responses:
            'Password for user wdchat': 'BBRyAPNh6g4H9qte'