Advertisement
corbins

Untitled

May 20th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. - block:
  2. - name:
  3. file:
  4. path: /usr/lib/dvn-dps/sql
  5. state: directory
  6. when: dps.db != 'localhost'
  7.  
  8. - name:
  9. synchronize:
  10. src: /usr/lib/dvn-dps/sql
  11. dest: /usr/lib/dvn-dps/
  12. mode: pull
  13. when: dps.db != 'localhost'
  14.  
  15. - name: get list of sql schema files in order
  16. command: sed -n '/vtc_files="/,/"/{/vtc_files="/b;/"/b;p}' create_database.sh
  17. args:
  18. chdir: /usr/lib/dvn-dps/sql
  19. warn: false
  20. register: dvn_db_schema
  21.  
  22. - name: create dvn database
  23. mysql_db:
  24. name: dvn
  25. state: present
  26.  
  27. - name: create dvn database schema
  28. mysql_db:
  29. name: dvn
  30. state: import
  31. target: /usr/lib/dvn-dps/sql/vtc/{{ item }}
  32. loop: "{{ dvn_db_schema.stdout_lines }}"
  33. delegate_to: "{{ dps.db if dps.db != 'localhost' else inventory_hostname }}"
  34. when: inventory_hostname == groups.dps | first
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement