- 
  file: 
    group: "{{ db2grp }}"
    mode: "0755"
    owner: "{{ db2usr }}"
    path: "/local/{{ database_dir }}"
    state: directory
  name: "Creating the Directory to for the Database"
- 
  name: "Creating DB2 Database: {{ db2dbname }}"
  raw: "su - {{ db2usr }} -c 'db2 create database {{ db2dbname }} on /local/{{database_dir}}'"
  ignore_errors: true
- 
  name: Creating Archive Log Folder /local-log/archive-logs
  file:
    path: /local-log/archive-logs
    state: directory
    mode: '0755'
- 
  name: "Enabling Log Archiving for HADR Database at: /local-log/archive-logs"
  raw: su - {{ db2usr }} -c "db2 update db cfg for {{ db2dbname }} using LOGARCHMETH1 'DISK:/local-log/archive-logs'"
